Antonio: AddPicture & EXCEL 2010

Antonio: AddPicture & EXCEL 2010

Postby sysctrl2 » Wed May 23, 2012 7:25 pm

Amigos:

como hago para insertar una imagen en una hoja de excel ?

la idea es insertar una imagen en la primera celda de la oSheet

el siguiente codigo marca error de ejecucion: ,

Error description: Error 3302404:SHAPES/3 DISP_E_MEMBERNOTFOUND: ADDPICTURE

Code: Select all  Expand view
#include <fivewin.ch>
FUNCTION MAIN()

    LOCAL oExcel, oSheet, oBook
    local cFile := 'OLGA1.JPG'

    oExcel = CreateObject( "Excel.Application" )
    oBook  := oExcel:WorkBooks:Add()
    oSheet := oExcel:Get( "ActiveSheet" )          
   
    //oSheet:Pictures:Insert( cFile )
   
    oSheet:Shapes:AddPicture( cFile, .F., .T., 0, 0, 200, 150 )

    oExcel:Visible = .T.
RETURN NIL


Gracias por la ayuda.
Cesar Cortes Cruz
SysCtrl Software
Mexico

' Sin +- FWH es mejor "
User avatar
sysctrl2
 
Posts: 981
Joined: Mon Feb 05, 2007 7:15 pm

Re: Antonio: AddPicture & EXCEL 2010

Postby anserkk » Fri May 25, 2012 5:19 am

Please specify the full path of the image file
For eg.
Code: Select all  Expand view
local cFile := 'C:\FWH\gifs\Fts.Gif'


Regards
Anser
User avatar
anserkk
 
Posts: 1331
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: Antonio: AddPicture & EXCEL 2010

Postby sysctrl2 » Fri May 25, 2012 7:10 pm

Anserkk, Many tanks.

Funciona perfecto,

gracias

saludos.
Cesar Cortes Cruz
SysCtrl Software
Mexico

' Sin +- FWH es mejor "
User avatar
sysctrl2
 
Posts: 981
Joined: Mon Feb 05, 2007 7:15 pm

Re: Antonio: AddPicture & EXCEL 2010

Postby sysctrl2 » Fri May 25, 2012 7:16 pm

amigos tambien funciona con:

oSheet:Pictures:Insert( cFile )

pero como dice el amigo Anserkk,

hay que indicar la ruta completa donde esta la imagen,

he probado con JPG y BMP funciona perfecto.



saludos...


Code: Select all  Expand view
#include <fivewin.ch>
FUNCTION MAIN()

    LOCAL oExcel, oSheet, oBook
    local cFile := 'C:\FWH\SAMPLES\OLGA1.JPG'

    IF FILE(cFile)
       ? 'si existe ...'
    endif
    oExcel = CreateObject( "Excel.Application" )
    oBook  := oExcel:WorkBooks:Add()
    oSheet := oExcel:Get( "ActiveSheet" )          
   
    oSheet:Pictures:Insert( cFile )
   
    //oSheet:Shapes:AddPicture( cFile, .F., .T., 0, 0, 200, 150 )

    oExcel:Visible = .T. //ñ
RETURN NIL
Cesar Cortes Cruz
SysCtrl Software
Mexico

' Sin +- FWH es mejor "
User avatar
sysctrl2
 
Posts: 981
Joined: Mon Feb 05, 2007 7:15 pm

Re: Antonio: AddPicture & EXCEL 2010

Postby goosfancito » Thu Oct 15, 2015 8:38 am

Buen dia.

Y si esa imagen la tengo dentro de un recurso?

gracias.
FWH 21.02
Harbour 3.2.0dev (r2104281802)
Copyright (c) 1999-2021, https://harbour.github.io/
User avatar
goosfancito
 
Posts: 1954
Joined: Fri Oct 07, 2005 7:08 pm

Re: Antonio: AddPicture & EXCEL 2010

Postby joseluisysturiz » Fri Oct 16, 2015 4:47 am

goosfancito wrote:Buen dia.

Y si esa imagen la tengo dentro de un recurso?

gracias.


Lo he intentado y buscado informacion y con el OLE no creo se pueda, ya que usa los mismo macros de VB y los que he visto alli, solo permite insertar imagenes desde disco, si consigues o logras algo y puedes compartirlo seria bueno, saludos... :shock:
Dios no está muerto...

Gracias a mi Dios ante todo!
User avatar
joseluisysturiz
 
Posts: 2064
Joined: Fri Jan 06, 2006 9:28 pm
Location: Guatire - Caracas - Venezuela


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 132 guests