Board index » delphi » Excel to Delphi Automation problems - Any Solutions?

Excel to Delphi Automation problems - Any Solutions?

I faced three major problems while working with XL to Delphi OLE Automation.

1- I was unable to call CreateOleObject() in any TThread derived class
because an exception 'CoInitialize has not been called occurs'.

2- When I added the call to CoInitialize(), a compile time error
'CoInitialize undeclared identifie occured'.

3- I replaced CoInitialize with CoInitializeEx(nil,0) the code compiled but
you can't use Microsoft defined constants for second parameters.

4- I am unable to call both CoUnInitialize or CoUnInitializeEx due to
undeclared identifier compile time error.

Can anybody tell me whats going on...

 

Re:Excel to Delphi Automation problems - Any Solutions?


Include ACTIVEX in your uses clause.

Quote
arsahd <eng...@yahoo.com> wrote in message

news:84cjhb$js412@forums.borland.com...
Quote
> I faced three major problems while working with XL to Delphi OLE
Automation.

> 1- I was unable to call CreateOleObject() in any TThread derived class
> because an exception 'CoInitialize has not been called occurs'.

> 2- When I added the call to CoInitialize(), a compile time error
> 'CoInitialize undeclared identifie occured'.

> 3- I replaced CoInitialize with CoInitializeEx(nil,0) the code compiled
but
> you can't use Microsoft defined constants for second parameters.

> 4- I am unable to call both CoUnInitialize or CoUnInitializeEx due to
> undeclared identifier compile time error.

> Can anybody tell me whats going on...

Other Threads