Read range Excel Error

Hi All,

I am facing an issue, when first time bot is reading the excel and stored the data into datatable and after manipulation of the data ,bot is writting back the maipulated data to the same excel.

At the time of re running the bot when it is going to read the same modified excel one saving pop up is comming and even after clicking manually on yes, read range activity throwing error and when I am checking the excel by opening it manually its showing document recovery stage.

how to resolve this any idea please , so that bot can read the file without throwing error when it is running for second time?

Thanks,
Ritesh

Hi @Ritesh_Burman

you can use the read range workbook activity to avoid that kind of things, also if you are working with application scope, uncheck the visible field
image

Regards

@fernando_zuluaga ,

I have to use excel application scope forcefully as it is too fast to read the entire huge datas from the excel compared to workbook activity, yes I have used this visible to uncheck but visibilty gets turned off of the excel but due to running in the background the save as yes no pop up is comming.

anyother way?

Regards,
Ritesh

also are you using the close workbook activity after the excel application scope?

Hi @fernando_zuluaga ,

Bot is getting stucked there itself as that save changes yes no pop up is comming and after manually clicking on it bot is running. but read range activity under excel scope throwing error there.

Regards,
Ritesh

Hi @Ritesh_Burman ,

Do you know the reason for the Pop-Up appearance ? We need to understand what is the manipulation being done in the excel that makes the pop up to be appeared.

Does the Pop-up also appear if the Task/Modification to the Excel was done manually ?
Understanding of why the pop-up appears would help us to solve this issue from the root itself instead of performing an UI Action for the Excel Pop-Up.

Do let us know more about the Pop-Up details and also the Excel Modification that you are performing.

Hi @Ritesh_Burman,

It seems like the Excel file is still open or in use when the bot is trying to access it for the second time, which is causing the error. To resolve this issue, you can try the following:

  1. Make sure that the Excel file is closed before running the bot again. You can manually close the file or use the Kill Process activity in UiPath to close the Excel process before accessing the file again.
  2. Check if there are any other applications or processes that are accessing the Excel file. Close those applications or processes before running the bot again.
  3. Try using the “Workbook” activities instead of the “Excel” activities in UiPath. The “Workbook” activities are more reliable and can handle concurrency issues better.
  4. If the issue persists, you can try copying the Excel file to a different location before reading it. This will ensure that the original file is not in use and can be accessed by the bot.
  5. You can also try adding a delay activity before the Read Range activity to ensure that the Excel file is fully closed before the bot tries to access it again.

I hope this helps to resolve the issue.