gpt4 book ai didi

c# - 错误 :-(Exception from HRESULT: 0x8001010A (RPC_E_SERVERCALL_RETRYLATER))

转载 作者:行者123 更新时间:2023-12-05 03:14:14 26 4
gpt4 key购买 nike

我在调试用于生成 Excel 工作表的 Windows 窗体应用程序时遇到以下错误:

Application is Busy.
(Exception from HRESULT: 0x8001010A (RPC_E_SERVERCALL_RETRYLATER)).

我已经彻底检查了代码,没有发现任何错误。互联网搜索表明问题出在 Microsoft.Office.Interop.dll 中。

我该如何解决?

最佳答案

当 Excel 等 Office 应用程序在某些模式对话框中等待或编辑公式处于事件状态并且应用程序未处于接受任何命令的状态时,通常会发生此问题。

在执行自动化任务时尝试使用 Excel 的可见性:

Microsoft.Office.Interop.Excel.Application ExcelApp = new Microsoft.Office.Interop.Excel.Application();                
ExcelApp.ScreenUpdating = true;
ExcelApp.Visible = true;
ExcelApp.Interactive = true;
ExcelApp.IgnoreRemoteRequests = false;

当然,在您找出问题所在之后,您的自动化会更快:

ExcelApp.ScreenUpdating = false;
ExcelApp.Visible = false;

关于c# - 错误 :-(Exception from HRESULT: 0x8001010A (RPC_E_SERVERCALL_RETRYLATER)),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26073754/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com