Click here to Skip to main content
15,892,005 members
Articles / Programming Languages / C#
Tip/Trick

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

Rate me:
Please Sign up or sign in to vote.
4.33/5 (3 votes)
25 Dec 2011CPOL 22.9K   1  
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.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
-- There are no messages in this forum --