I am getting the following error while debugging my Windows Form Application for generating an excel sheet:
Application is Busy.
(Exception from HRESULT: 0x8001010A (RPC_E_SERVERCALL_RETRYLATER)).
I have gone thoroughly through the code and have not found any errors. An internet search suggests the problem is in Microsoft.Office.Interop.dll
.
How can I resolve this?
This problem usually happens when the Office application like Excel is waiting in some modal dialog or editing formula is active and the app is not in a state to accept any commands.
Try to play with visibility of Excel while you execute your automation tasks:
Microsoft.Office.Interop.Excel.Application ExcelApp = new Microsoft.Office.Interop.Excel.Application();
ExcelApp.ScreenUpdating = true;
ExcelApp.Visible = true;
ExcelApp.Interactive = true;
ExcelApp.IgnoreRemoteRequests = false;
Of course after you find out what the problem is, your automation will be faster with:
ExcelApp.ScreenUpdating = false;
ExcelApp.Visible = false;
User contributions licensed under CC BY-SA 3.0