I am using Excel application scope and refresh pivot activity in my process. But most of the times process breaks in run on Excel application scope and refresh pivot activity with error:
—> System.Runtime.InteropServices.COMException (0x80010001): Call was rejected by callee. (0x80010001 (RPC_E_CALL_REJECTED))
at Microsoft.Office.Interop.Excel._Workbook.get_Sheets()
at UiPath.Excel.WorkbookApplication.SetSheet(String sheetName, Boolean createNew)
— End of inner exception stack trace —
Excel file contains a lot of formulas, one pivot table and that’s probably the issue for UiPath. I tried to put delays before excel application scope, and even kill excel before excel application scope but nothing works.
What other solutions can I use in this case, I need to refresh pivot table in excel.
This error arises when your Excel remains open at the background. Suggestion would be to go to Task Manager and cloase Microsoft Excel but it’s not an good practice also so, use Kill process at starting of the workflow to kill the excel so that error won’t arise again.