Accessing Outlook COM object results in Error 0x80080005 CO_E_SERVER_EXEC_FAILURE

0

A couple of my customers are getting this error when my product attempts to access Outlook via out-of-process Outlook COM objects and Redemption COM objects.

I've read that this error can occur if my product and Outlook are running at different privilege levels (e.g., Outlook as Administration, my product as Standard User). Are there any other possible causes?

Here's the error call stack:

System.Runtime.InteropServices.COMException (0x80080005): 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)).
at
System.Runtime.Remoting.RemotingServices.AllocateUninitializedObject(RuntimeType objectType)
at
System.Runtime.Remoting.Activation.ActivationServices.CreateInstance(RuntimeType serverType)
at
System.Runtime.Remoting.Activation.ActivationServices.IsCurrentContextOK(RuntimeType serverType, Object[] props, Boolean bNewObj)
at
System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at
System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at
System.Activator.CreateInstance(Type type, Boolean nonPublic)
at
System.Activator.CreateInstance(Type type)

outlook
com
outlook-redemption
asked on Stack Overflow Feb 13, 2017 by Jeff

2 Answers

0

It is either because the out-of-proc object (Outlook) crashed and the COM proxy in your address process can no longer talk to it or because the security contexts are different.

0

Where do you try to automate Outlook?

Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment.

If you are building a solution that runs in a server-side context, you should try to use components that have been made safe for unattended execution. Or, you should try to find alternatives that allow at least part of the code to run client-side. If you use an Office application from a server-side solution, the application will lack many of the necessary capabilities to run successfully. Additionally, you will be taking risks with the stability of your overall solution. Read more about that in the Considerations for server-side Automation of Office article. You may consider using a low-level API (Extended MAPI) for using on the server-side instead of OOM.

Also you may find the When CoCreateInstance returns 0x80080005 (CO_E_SERVER_EXEC_FAILURE) article which describes a similar issue helpful.

answered on Stack Overflow Feb 20, 2017 by Eugene Astafiev

User contributions licensed under CC BY-SA 3.0