What would cause Outlook automation to suddenly fail, and how to get it back up?

-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.

c#
outlook
office-interop
mscorlib
comclass

1 Answer

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?


User contributions licensed under CC BY-SA 3.0