如何解决消息过滤器指示应用程序正忙.(来自HRESULT的异常:0x8001010A(RPC_E_SERVERCALL_RETRYLATER))

Mil*_*war 7 c# asp.net ms-office office-interop

PowerPoint.Application PowerPoint_App;
PowerPoint_App = new PowerPoint.ApplicationClass();
PowerPoint_App.DisplayAlerts = PowerPoint.PpAlertLevel.ppAlertsNone;
PowerPoint.Presentation presentation;
presentation = null;
try
{
    PowerPoint_App.Visible = MsoTriState.msoTrue;
    presentation = PowerPoint_App.Presentations.Open(strPptFilePath, Microsoft.Office.Core.MsoTriState.msoFalse, Microsoft.Office.Core.MsoTriState.msoFalse, Microsoft.Office.Core.MsoTriState.msoFalse);
    PowerPoint.Slide tempSlide = null;
    int totalSlides = presentation.Slides.Count;
    int slideNo = 0;
Run Code Online (Sandbox Code Playgroud)

我在PowerPoint_App.Presentations.Open代码上得到以下异常.

异常消息:消息过滤器指示应用程序正忙.(来自HRESULT的异常:0x8001010A(RPC_E_SERVERCALL_RETRYLATER))

我之前在这段代码中没有收到此错误.以前一切都很完美.有人可以帮忙吗?

Mil*_*war 7

我最终删除了:

 PowerPoint_App.Visible = MsoTriState.msoTrue;
Run Code Online (Sandbox Code Playgroud)

它奏效了……!!!

  • 办公室应用程序(powerpoint)可能只是显示一些消息(如重新激活消息、新闻或任何它可能选择在启动时显示的消息)并等待您点击它......“DisplayAlerts=None "不会阻止那些。这有时是此错误的原因。尝试简单地手动启动 PowerPoint,看看启动时是否有一些弹出消息。 (10认同)