OLE file name

OLE file name

Postby Eugeniusz Owsiak » Thu Oct 20, 2005 7:07 pm

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
Eugeniusz Owsiak
 
Posts: 60
Joined: Fri Oct 07, 2005 5:38 am
Location: Poland

Re: OLE file name

Postby Richard Chidiak » Thu Oct 20, 2005 7:55 pm

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
Richard Chidiak
 
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France

Postby Eugeniusz Owsiak » Fri Oct 21, 2005 5:37 am

Richard,

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


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

Postby Richard Chidiak » Fri Oct 21, 2005 6:32 am

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
Richard Chidiak
 
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France

Postby Enrico Maria Giordano » Fri Oct 21, 2005 7:58 am

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
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 77 guests