Delete recently downloaded file

Hi All, can anyone help on this error?

Background: I have downloaded a csv file and save it as excel workbook format. Then using excel application activity I copied the data from that saved excel file to another excel file (my working file). Now the initially downloaded and saved file needs to be deleted.

Problem: the delete file activity is not working and prompting below error:


Thanks in advance:)

Is the original file still open when you are trying to delete it? That error message means that another process is actively using that file. This is usually because it is still opened.


Use Kill Process activity and specify process name as “excel” to close all opened excel files and then use Delete activity.

actually when i run the bot without the delete activity, all the files automatically save and close. But when I added the delete activity and re-run the bot, the excel file i am trying to delete retains open and thus, prompting tat error…

would there be a chance to select only a specific “excel” to be killed?

Are you deleting it inside the scope that you are using it? The delete needs to be outside of the scope.

yeah it’s outside

Can you remove the delete and pause the robot at the point where the delete would be. Then check task manager to see if there are any excel processes in the background.

sorry how can i pause it before it gets to the delete activity?, if remove the delete activity the process ends…

Just put in a message box with some blank text, it’ll pause the bot until you click Ok.


it still retains open, and yeah there is an excel application running (that file)

see below screenshot…

Try using a Close Workbook activity to make sure that the excel file is closed before deleting it.

if i use Kill process activity, what shall i put in the process field?


You have to specify ProcessName field as “excel” to kill Excel process.

thanks much:) this works!!!

1 Like

thanks for this as well:)


Please don’t use kill process for Excel in production environment, it may lead to issue.

I had bad experience with kill ( Excel) , so I am very careful while using kill for Excel.

Just wanted to make you little cautious.


This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.