 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Dorothy Guest
|
Posted: Mon Sep 12, 2005 11:57 am Post subject: Reference to Excel file |
|
|
Hi,
I need to get the reference of a given Excel file using OLE. If I use
GetActiveOLEObject, it gives me the reference to the active excel file that
is open.
But I need to open a particular excel file (file name given by the
application). I use OLE to read/write from/to excel.
Please Help!
Sorry I have posted the message earlier by mistake in delphi.general
newsgroup also.
Thanks,
Dorothy
|
|
| Back to top |
|
 |
Mike Shkolnik Guest
|
Posted: Mon Sep 12, 2005 3:11 pm Post subject: Re: Reference to Excel file |
|
|
Use the next code:
try
xls := GetActiveOleObject('Excel.Application');
except
xls := CreateOleObject('Excel.Application');
end;
xlw := xls.WorkBooks.Open(yourFileName)
....
--
With best regards, Mike Shkolnik
EMail: [email]mshkolnik (AT) scalabium (DOT) com[/email]
http://www.scalabium.com
"Dorothy" <dorothysunitha (AT) hotmail (DOT) com> wrote
| Quote: | Hi,
I need to get the reference of a given Excel file using OLE. If I use
GetActiveOLEObject, it gives me the reference to the active excel file
that
is open.
But I need to open a particular excel file (file name given by the
application). I use OLE to read/write from/to excel.
Please Help!
Sorry I have posted the message earlier by mistake in delphi.general
newsgroup also.
Thanks,
Dorothy
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|