Write Cell Workbook - The process cannot access because it is being used by another process

I am taking RPA Training course and practice reading and writing Excel with UiPath. I ran into the error at Write Cell Workbook: The process cannot access the file because it is being used by another process. I tried delay for 2 secs but still would not work.

Hi @thao.dinh

try using kill process before write cell workbook

Or increase the delay to 5 sec

Or use one excel application scope and do all the activities inside them…so that the excel is not opened multiple times and you can set application scope to not visible as well

Hope this helps :slight_smile:

1 Like

Hi @AJ_Ask ,

I suppose you have the targetted workbook open when trying to execute the workbook.

The Best practice to follow when we are automating any application or browser is to check if the target application/browser is open before starting the actual automation to avoid any exceptions like this.

Please try closing the workbook before executing the bot.

or

add a sequence to check if workbook is open and close it as required.

Happy Automating…!

Thanks,
Gautham.

1 Like

Hi @thao.dinh ,
The message content shows that your Excel is open, try it

  1. kill Excel process before “write cell” or
  2. Open task manager to see which tasks are taking up Excel, restart the computer before running again. To ensure a process works well, kill the applications used in the process before Run
    Regards,
    Luong
1 Like

@thao.dinh,

Welcome to the UiPath Community :tada:

Root Cause:
You are using Write Cell Workbook Workbook activity which have some of it’s own advantages and limitations.

One of the limitation is it will fail or throw exception if the file it’s going to use is already open on the system.

Solution:

You can use kill process activity before using workbook activity to kill excel.

Thanks,
Ashok :slight_smile:

1 Like

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