 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Sandra Guest
|
Posted: Tue Apr 26, 2005 11:15 am Post subject: Using Excel in an OLEContainer |
|
|
Hi, I have an application which opens an excel file in an OLE
container. With a TExcelWorkbook component, I'm using :-
ExcelWorkbook1.ConnectTo(OLEContainer1.OLEObjectInterface as
_Workbook)
to get a reference to the opened workbook. However, my application
uses a number of dll's which reference the opened workbook and refer
to it via a class which stores the current excel application, the
workbook opened and the worksheet. As I cannot refer to the
TExcelApplication, TExcelWorkbook and TExcelWorksheet components from
my dll's, I need the equivalent _Application, _Workbook and _Worksheet
objects. I can use :-
aWorksheet := ExcelWorkbook1.Worksheets[1] as _Worksheet;
to get a _Worksheet object, but I also need a _Workbook and
_Application object. Is their any reliable way of getting the correct
reference to the excel application and workbook?
This area has me confused! There seem to be so many ways to connect
to an excel application, but varying between these methods causes
problems!
Thanks for any help
Sandra
|
|
| Back to top |
|
 |
Sandra Campbell Guest
|
Posted: Tue Apr 26, 2005 7:04 pm Post subject: Re: Using Excel in an OLEContainer |
|
|
Sorry folks, have worked it out!
Just having problems with different type libraries and different versions of
Delphi!
"Sandra" <sandra.campbell (AT) ent-lib (DOT) co.uk> wrote
| Quote: | Hi, I have an application which opens an excel file in an OLE
container. With a TExcelWorkbook component, I'm using :-
ExcelWorkbook1.ConnectTo(OLEContainer1.OLEObjectInterface as
_Workbook)
to get a reference to the opened workbook. However, my application
uses a number of dll's which reference the opened workbook and refer
to it via a class which stores the current excel application, the
workbook opened and the worksheet. As I cannot refer to the
TExcelApplication, TExcelWorkbook and TExcelWorksheet components from
my dll's, I need the equivalent _Application, _Workbook and _Worksheet
objects. I can use :-
aWorksheet := ExcelWorkbook1.Worksheets[1] as _Worksheet;
to get a _Worksheet object, but I also need a _Workbook and
_Application object. Is their any reliable way of getting the correct
reference to the excel application and workbook?
This area has me confused! There seem to be so many ways to connect
to an excel application, but varying between these methods causes
problems!
Thanks for any help
Sandra
|
|
|
| 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
|
|