OLE file name

Post Reply
User avatar
Eugeniusz Owsiak
Posts: 60
Joined: Fri Oct 07, 2005 5:38 am
Location: Poland

OLE file name

Post by Eugeniusz Owsiak »

Hallo
How can I get name of opened thru OLE xls file?

....
oExcel := TOleAuto():New( "Excel.Application" )
oExcel:WorkBooks:Open(cGetFile("*.XLS", "Select Excel File"))
//msginfo(oExcel:WorkBooks:FileName())
...

Regards Eugeniusz
User avatar
Richard Chidiak
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France
Contact:

Re: OLE file name

Post by Richard Chidiak »

Eugeniusz Owsiak wrote:Hallo
How can I get name of opened thru OLE xls file?

....
oExcel := TOleAuto():New( "Excel.Application" )
oExcel:WorkBooks:Open(cGetFile("*.XLS", "Select Excel File"))
//msginfo(oExcel:WorkBooks:FileName())
...

Regards Eugeniusz
:)

Try it this way

CFILE := cgetfile32("*.xls", "Sélectionnez le fichier",1,ALLTRIM(BDEF->CHEMIN))

oExcel:WorkBooks:Open( CFILE )

Richard
User avatar
Eugeniusz Owsiak
Posts: 60
Joined: Fri Oct 07, 2005 5:38 am
Location: Poland

Post by Eugeniusz Owsiak »

Richard,

I think it is a good and simple solution but where can I found info of oExcel object property?


regards Eugeniusz
User avatar
Richard Chidiak
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France
Contact:

Post by Richard Chidiak »

Eugeniusz Owsiak wrote:Richard,

I think it is a good and simple solution but where can I found info of oExcel object property?


regards Eugeniusz
Eugeniusz

Sorry i do not understand the question

What exactly are you looking for ? Active sheet ?

If so try

oSheet = oExcel:Get( "ActiveSheet" )
nRows := oSheet:UsedRange:Rows:Count()
nCols := oSheet:UsedRange:Columns:Count()


Richard
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Post by Enrico Maria Giordano »

Eugeniusz Owsiak wrote:Richard,

I think it is a good and simple solution but where can I found info of oExcel object property?


regards Eugeniusz
Search for VBA*.CHM in your hard disk.

EMG
Post Reply