65.9K
CodeProject is changing. Read more.
Home

System.Runtime.InteropServices - An approach to debugging for COMException (0x80010108)

starIconstarIconstarIconstarIcon
emptyStarIcon
starIcon

4.33/5 (3 votes)

Nov 29, 2011

CPOL
viewsIcon

23034

An approach to debugging for COMException (0x80010108): The object invoked has disconnected from its clients.

I got this error using Office automation:
System.Runtime.InteropServices.COMException (0x80010108): The object invoked has disconnected from its clients. (Exception from HRESULT: 0x80010108 (RPC_E_DISCONNECTED)),
It can be nasty to debug. One strategy to address this error is to see if an event has occurred to interrupt the Office application running under automation. I traced my problem to a Word macro I was running from a Visual Basic program. I did not notice that the macro caused Word to exit. Once Word shut down, the automation couldn't continue and I got the error that the "object invoked has disconnected." The solution was to edit the macro so it ran without shutting down Word. Perhaps this will help someone.