-1

I've got an app that generates email and pops up an OUtlook dialog, showing the user what is about to be sent. It has been working fine but, with no code changes, is now nonfunctional. The exception generated is:

Exception message: Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80080005 Server execution failed (Exception from HRESULT: 0x80080005 (CO_E_SERVER_EXEC_FAILURE)). Exception Source: mscorlib

...and is thrown on this line:

Microsoft.Office.Interop.Outlook.Application app = new Microsoft.Office.Interop.Outlook.Application();

Outlook itself is working fine otherwise; in fact, I've got my app set up to send these emails using Outlook, but I'm also sending email via my gmail account to myself whenever an exception occurs - that is how I got this exception information - nothing displayed on the screen or indicated a problem - the Outlook mail message just never came up.

If this persists, I will just change my Outlook mail sending code to gmail, also, but would prefer to stick with Outlook for this.

B. Clay Shannon-B. Crow Raven
  • 8,547
  • 144
  • 472
  • 862
  • 1
    Were any office updates applied via windows update? You may need to see if the COM you were using was affected in some way. Or if the security settings for Outlook were modified in such a way as to prevent you from opening/attaching to an instance. – Tommy Apr 01 '16 at 23:07
  • There may have been some updates applied; not on my watch, though (overnight, quite possibly). How would I check those things you mentioned? – B. Clay Shannon-B. Crow Raven Apr 01 '16 at 23:11
  • 1
    Evaluation license expiry? – Glen Thomas Apr 01 '16 at 23:12
  • @GlenThomas: I doubt it; this is a healthy mid-sized company that has been using Outlook for many years, so I doubt it's an expiry issue. I'll ask the cats who know about those details Monday when they get back, though. – B. Clay Shannon-B. Crow Raven Apr 01 '16 at 23:15
  • 1
    I have had office licenses expire in a few healthy mid-sized companies before as the software often gets thrown on and only gets properly licensed when the evaluation breaks and it no longer works. – Glen Thomas Apr 01 '16 at 23:16
  • Okay, thanks, I'll look into that. – B. Clay Shannon-B. Crow Raven Apr 01 '16 at 23:20

1 Answers1

1

Mots likely cause of this error is a mismatched security context - is either Outlook or your app running in an elevated (Run as Administrator) context?

Dmitry Streblechenko
  • 62,942
  • 4
  • 53
  • 78