CO_E_SERVER_EXEC_FAILURE when trying to open PPT-File on CLIENT

0

Please note that this is NOT about a server - component or ASP.NET.

This happens on a Client-Application (WinForms)

I try to open a PPT-File from within my application. The following code works fine on my machine:

   _ppApp = new Microsoft.Office.Interop.PowerPoint.Application();
                _ppApp.DisplayAlerts = PpAlertLevel.ppAlertsNone;
                _ppApp.SlideShowEnd += PpApp_SlideShowEnd;

But at least on the machine of one user (the first that tried to run it) the first line already throws the following exception:

Retrieving the COM class factory for component with CLSID {91493441-5A91-11CF-8700-00AA0060263B} 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)

I've seen this kind of error here on SO on various server-related snippets where the solution was about changing server and or service-behaviour.

But this is a pure client application causing that trouble. The customer has a modern office installed. What might cause this behavior?

c#
office-interop
asked on Stack Overflow Oct 18, 2017 by Ole Albers

1 Answer

0

I realise this answer comes a bit late, and perhaps you have already solved it (in that case it might at least be useful to future readers). I have had this problem today and this behaviour may be occuring because your PowerPoint and Client Application are being run with different rights.

For example, PowerPoint might be running with normal user privileges and your Client App might be running as an administrator. This will cause it to hang for a while and then result in the error you described. The solution is to run both programs with similar privileges. So either both as admin or both as a normal user. This prevented the error in my case which sounds very similar to yours (WPF app accessing an open PowerPoint presentation).

answered on Stack Overflow Mar 20, 2018 by NullError • edited Mar 21, 2018 by NullError

User contributions licensed under CC BY-SA 3.0