Delete file System exception

Hi,

I’m seeing the error “The process cannot access the file “File name” because it is being used by another process.”

The bot executes the delete activity to delete the excel file that has been created and processed in prior.

I have checked in debug mode, it seems the excel scope activity is closing the excel and there is a kill process “Excel” activity too and delay of 15 seconds before the delete activity, still the above mentioned exception is displayed.

In debug mode What I saw was after excel scope activity closes the excel file, I tried to open it which should open but, here there is an error in excel when opened manually says “Excel cannot open the File because the file name or extension is not valid. Verify that the file has not been corrupted and that the file extension matches the format of the file”. Please see the screenshots.

After stopping or bot completes its process steps, the same excel file opens without any popup messages from excel.

What I learn is that UiPath executor during execution of the bot somehow is not releasing the excel file and thus while deleting an excel that had been created using the bot process steps throws the above mentioned error.


Thanks
Sreekar

Hi @sreekar22 go to task manager and kill the excel process , then try …

Hi Tapan,

There is no excel open in Task manager too to close, Any other ideas you have, so that we could give a shot.

Thanks
Sreekar

Could you send your workflow?

OR

check is there any other activities used that excel file.

Hello @sreekar22

Is it happening for each execution? Can you try restart your machine and try it once.

Any other process is accessing this file?

Thanks

Your Excel file is corrupter @sreekar22 , Can you Recreate the Excel again and check it.

Have changed the Format of the excel file?

Regards
Gokul

@sreekar22 ,
May i know to which format are you trying to save?
Xls or Xlsx??

Can you save it to both formats and check if any of the format is working?