简体   繁体   中英

CO_E_SERVER_EXEC_FAILURE when trying to open PPT-File on CLIENT

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM