Excel application scope - Call was rejected by callee

Hi all,

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.

Thanks for your help!

Hi @mkriznjak

This happens because the excel remains open, my suggestion is to open the task manager and close it from here.

HI @mkriznjak

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.

Hope you understand!!
Regards

Before excel application scope I put activity Kill process, and still the same issue from time to time

Screenshot 2024-01-16 114833

Before excel application scope I put activity Kill process, and still the same issue from time to time
Screenshot 2024-01-16 114833

@mkriznjak

Please check on this