Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming,microsoft.public.excel.misc
|
|||
|
|||
Close Excel server after activating OLE object
We have an application that processes multiple excel objects that
embedded into RTF. To process an object I need to active it in place, get the pointer to the workbook, call some functions and then close the workbook and object. I use the following code: LPOLEOBJECT object; // Getting pointer to the object ......... LPOLECLIENTSITE site; object-GetClientSite(&site); result = object-DoVerb(OLEIVERB_INPLACEACTIVATE, NULL, site, 0, NULL, NULL); if (result == S_OK) { // Do actions... } object-Close(); site-Release(); object-Release(); In most cases everything works OK without any problems. But sometimes, we encounter very strange excel tables and when I call DoVerb, I get such result: 0x80010105 The server threw an exception. I don't really know the reason, why Excel server does not process the documents. More interesting, when I open an RTF document in Word and double click the embedded excel table, I get the error message, that the application cannot process object. OK, so maybe the object is corrupted. However, when I open the RTF in OpenOffice, I can double click on excel table and it will activate fine. We can live with the corrupted tables in our application. We just need to inform the user about that. And here I have such problem: Excel server throws an exception when calling DoVerb and it does not close after that. Excel server keeps hanging in the memory and does not open correctly non of the following excel tables in the document (even if they are not corrupted). So the question is: how to close the Excel server that didn't activated the document after calling DoVerb? I thought, maybe it is displaying some message boxes, but it is not in the UI state. The excel sheet (which I got, after opening it in the OpenOffice) has some formulas that reference other files that I don't have. Maybe Excel tries to recalculate formulas and thus hangs? I would appreciate any help. Thanks in advance. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Activating object from Excel cell | Excel Worksheet Functions | |||
Close Excel server after activating OLE object | Excel Discussion (Misc queries) | |||
Excel Server Object won't overwrite | Excel Worksheet Functions | |||
How to hide Excel window when activating a Shape object | Excel Programming | |||
How to hide Excel window when activating a Shape object | Excel Programming |