Excel Process Hung

I have a process that copies lines from one Excel file to another.
This is looped about 15 times, during which Excel is opened and closed over and over.
After a few loops, the process usually errors out because an Excel file didn’t open like it was supposed to, and so the robot could not find the selector.
When I check task manager, I see an EXCEL.EXE process that is running, but no Excel windows are open.

Does anyone know what is causing this problem and how I can fix it?

Thank you,

Hello @in006
Are you forced to copy data from excel rather than just using Read Range activity?

Excel Scope could potentially leave an instance opened in the background. I would recommend always using Close Workbook activity at the end of your scopes; you can just use a Workbook variable as the Output of the Excel scope, then place that variable in the Close Workbook.

I don’t know if that solves it entirely, but hope it helps.

1 Like

Hi @reda,
Yes, I can’t use read range because of the large number of lines.
UiPath just crashes.

1 Like

Thanks for the suggestion @ClaytonM,
I do use an Excel Scope in my process, I’ll try adding the Close Workbook activity.

What about when opening Excel with Open Application?
Do you know if this method also leaves an Excel instance opened in the background?

Thank you,

Open Application will leave the file opened, but not usually in the background. If there is a rare situation where you need to use that prior to an Excel Scope (maybe to leave file open), make sure you close it with either Close Window or Close Workbook.

1 Like

Hi @in006
I wanted to know that you have this problem of large excel sheets to suggest other packages to try in case you didn’t try them before,
these are the packages

the XlExcel has its own excel application scope and a read range activity
hope that was helpful

Hi @in006,

To Copy the Excel data you can use this activity.


@ClaytonM I use Open Application to open Excel but to close it I usually just click the X button or send ALT+F4.
That might be why Excel instances are staying open in the background.
I’ll try closing with Close Window or Close Workbook.

Thanks again,