What might be the reason for Excel.exe running in background even though the activity has been ended?

Hello

Could you help me to resolve the below problem?

I want to run Excel Workbook Scope inside a loop activity but I get error at random saying ‘Exception from HRESULT: 0x800A03EC’.

The number of excel files to be processed is around 50. I thought the excel.exe would be closed once each file is done. But apparently it is on in background. Is there any way to reslove this issue?

I learned that it might cause a problem if Excel is running in background so I would like to know if it is possible to kill it once each file is done.

Hi,

For each file after opening the excel file, use kill process to kill the excel.

Specify the process name in Kill Process activity as “Excel”

1 Like

@9e389f79ff1549b677ac,

You could use excel application scope too, it has a property called “Visible”, uncheck it.

Cheer,
Pankaj

Hi

I guess the best option is to add a Kill Process activity after processing the excel file in the for each loop…

So basically you have a for each, and within it you have a excel application scope. You do the stuff within it and once you exit the excel application scope, adding a kill process activity will kill any running excel processes before the next iteration of the loop…

For the kill process activity, add the process name as “Excel”

This should work for you…

Hey @9e389f79ff1549b677ac

From My Personal opinion Instead of kill Excel Process, Just kill Particular Excel Sub Process(Yourfilename.xlsx).

-> First Get Process By name.
-> Use For each for Iteration
->Use If condition to match with your filename which you are processing and use this with Kill Activity.

Regards…!!
Aksh

Might be related:
https://forum.uipath.com/t/excelapplicationscope-random-hresults/98814/2

Try adding small delay if you have a tight loop.