none
Error System.Runtime.InteropServices.COMException (0x80080005) RRS feed

  • Question

  • I’m getting this error and I’m still couldn’t repair it, even after days of searching in different blogs and trying different tips. Here is the explanation of the problem:

    I’ve developed a solution for Office 2010, which consists of two big parts:

    1- An Addin for Powerpoint 2010 (basically, it detects slides and transitions and then write some encrypted data, for security reasons, on a text file). This addin was created using a standard VS 2010 solution (targeting the VSTO 4.0 and Office 2010, in C#). The Powerpoint application instantiation code is the following:

    1<sup>st</sup>: declared as a member, in the Addin class:

    Microsoft.Office.Interop.PowerPoint.Application powerPoint;

     

    2<sup>nd</sup>: instantiated at the beginning of the ThisAddIn_Startup method:

    powerPoint = this.Application;

     

    2- A WinForms application (targeting Office 2010) which decrypts and then processes the text file written previously by the addin. This application also instantiates and uses Powerpoint, and this is the instantiation code:

    “…

    Microsoft.Office.Interop.PowerPoint.Application application = new Microsoft.Office.Interop.PowerPoint.Application() as Microsoft.Office.Interop.PowerPoint.Application;

    …”

     

    I also have similar versions for the same solution (addin & winforms application) that have been built in VS 2008 for Office 2003 (VSTO 2005 SE) and Office 2007 (VSTO 3.0) and both always worked OK. For the 2007 version I’d basically followed this instructions -> http://msdn.microsoft.com/en-us/library/cc563937(v=office.12).aspx and for the 2010 version I’m still using the same deploy procedure (through windows installer) but, as is said previously, using Office 2010 assemblies and VSTO 4.0.

    Well, the error happens ONLY when I install and use the addin AND the winforms application in the same PC; If I open the winforms application, I get an error in the previous code line (instantiation of Powerpoint): “System.Runtime.InteropServices.COMException (0x80080005): Retrieving the COM class factory for component with CLSID {91493441-5A91-11CF-8700-00AA0060263B} failed due to the following error: 80080005.”

     

    But, If I install and use only ONE of the two applications (the addin OR the winform application) then both of them work without any problem. Even if I install both applications but then deactivate the addin (changing the LoadBehavior parameter in the registry, from 3 to 0), the 80080005 COM error disappears.

    I’m testing this using Win 7 and Office 2010, both in their professional version, English language and 32 bits.

     

    Could anybody help me, please? TKS !

    Tuesday, March 8, 2011 7:36 PM

Answers

  • Hello,

    Do you run A) PP first and the app then or B) the app first and PP then? If the exception occurs in case A, then I'd suggest checking if using Marshal.GetActiveObject solves the issue (see the page Tom mentions).

    If this doesn't help, then please simplify the code of the add-in and the application and allow me to download them. 


    Regards from Belarus (GMT + 2),

    Andrei Smolin
    Add-in Express Team Leader
    • Marked as answer by Bessie Zhao Friday, April 8, 2011 9:26 AM
    Monday, March 28, 2011 2:04 PM

All replies

  • Hi alohigor,

    Thanks for posting in the MSDN Forum.

    It’s based on my analysis that the problem exists at the PowerPoint instances’ invoke. Please take a look at that blog, it maybe can help you: http://blogs.msdn.com/b/andreww/archive/2008/11/30/starting-or-connecting-to-office-apps.aspx  .

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, March 10, 2011 1:10 AM
    Moderator
  • Hello,

    Do you run A) PP first and the app then or B) the app first and PP then? If the exception occurs in case A, then I'd suggest checking if using Marshal.GetActiveObject solves the issue (see the page Tom mentions).

    If this doesn't help, then please simplify the code of the add-in and the application and allow me to download them. 


    Regards from Belarus (GMT + 2),

    Andrei Smolin
    Add-in Express Team Leader
    • Marked as answer by Bessie Zhao Friday, April 8, 2011 9:26 AM
    Monday, March 28, 2011 2:04 PM