Page 1 of 1
OLE file name
Posted: Thu Oct 20, 2005 7:07 pm
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
Re: OLE file name
Posted: Thu Oct 20, 2005 7:55 pm
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
Posted: Fri Oct 21, 2005 5:37 am
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
Posted: Fri Oct 21, 2005 6:32 am
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
Posted: Fri Oct 21, 2005 7:58 am
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