Once more about the COM error 0x80010108 ("The object invoked has disconnected from its clients.")

  • Thread starter Thread starter martin-g
  • Start date Start date
M

martin-g

Hi.

When the user opens the Excel file, which is at the same time used by
my application, it stops calculations and throws an exception with such
information: "The object invoked has disconnected from its clients".
What can I do to resolve this? My application opens the source excel
file using this statement:

oRatelistWbk = AppExcel.Workbooks.Open(
m_FilePath, Missing.Value, true, Missing.Value, Missing.Value,
Missing.Value, Missing.Value, Missing.Value, Missing.Value,
Missing.Value, Missing.Value, Missing.Value, Missing.Value,
Missing.Value, Missing.Value
);

Note, that the file is opened for reading only.

TIA

Martin
 
| Hi.
|
| When the user opens the Excel file, which is at the same time used by
| my application, it stops calculations and throws an exception with such
| information: "The object invoked has disconnected from its clients".
| What can I do to resolve this? My application opens the source excel
| file using this statement:
|
| oRatelistWbk = AppExcel.Workbooks.Open(
| m_FilePath, Missing.Value, true, Missing.Value, Missing.Value,
| Missing.Value, Missing.Value, Missing.Value, Missing.Value,
| Missing.Value, Missing.Value, Missing.Value, Missing.Value,
| Missing.Value, Missing.Value
| );
|
| Note, that the file is opened for reading only.
|
| TIA
|
| Martin
|


We can't help you if you only post a single statement, which doesn't even
throw the exception, you have to post a complete sample that illustrates the
issue.
Note that, this statement doesn't open a file as such, it orders Excel to
open a workbook, and return a COM interface pointer to the workbook instance
(.NET receives a RCW wrapping the COM ITF). This exception is typically
thrown when such a RCW is getting detached from it's underlying COM
reference. That means you must be referring to an RCW which was detached
(voluntary or by mistake) from the underling COM reference, note that the
RCW doesn't have to relate to the workbook reference, it may also relate to
implicit references obtained during runtime.



Willy.
 
Willy said:
We can't help you if you only post a single statement, which doesn't even
throw the exception, you have to post a complete sample that illustrates the
issue.

Point is that there is no specific statement in the program which may
cause this error. It may happen with any statement calling any methods
of the open workbook object. I made some other tests and found out,
that the error doesn't occur, if I open that workbook using other Excel
instance, i.e. start another instance of Excel and then open the
workbook there. But if I double click on the workbook's icon, it
utilizes the instance of Excel which was created by my application. It
shows Excel window, which was hidden in my app, shows the workbook open
in it (yes, it was already open from my application), and then the
error comes out.
 
Back
Top