Excel File locked

when I open an excel file it shows file is locked for editing in UiPath.how to resolve this issue

Hi @Sonali_Gupta1
If UiPath reports an Excel file as locked for editing, ensure the file isn’t already open in another application or process that the automation account has the necessary permissions, and that no hidden Excel files are causing conflicts.

Happy Automation

As mentioned in the screenshot - UiPath cannot open a file which is already opened by someone. Same as the system behavior

Request the user to close the file and it should work

Ideally - BOT’s process should have a shared folder to keep all the input and output file where human access is limited. If human input is required - Agree on a time line to make sure that the file is not used in parallel

Actually, this process uses many excel files in different xamls but I have enabled kill activity in the starting. But after processing all the files this error Cames on the last xaml.So how to resolve it?
TIA

it is already placed in the temp folder of the code in the production.

@Sonali_Gupta1

Just put short Delay after processing each file to allow Excel to release any locks. Additionally, implement a Try-Catch block around your Excel activities to manage locked file exceptions and retry if necessary.

Confirm Keep file open is unchecked

Also add kill process excel activity with continue on error as true after closing each of the excel file

@Sonali_Gupta1

check excel permissions, if all permissions has granted . try below options,

If you are using modern activities look the properties section is there by mistake/wantedly check read only check box, if yes disable that.

if you are using many excel files try to close after processing that excel file. then go with next one

try above methods..

Happy automation!!

it is already unchecked

In the screenshot - there is a name displayed rite. Do you know the user??

Or Is the file open in your machine while running the bot

Go To task Managed and kill all the process related to excel

Run it from Studio Again

actually when I ran the bot it failed.After failing,I have opened the machine.When I open the machine it shows me this dialog box-


when I open the file from the frolder it shows already in use.how to resolve it

I believe the file got corrupted

Is it possible to create a fresh copy from the source and give a try replacing all the files in the project folder

but after multiple re-run from multiple location,it ran successfully

Are you opening different excel within the scope of another excel??

Also could you please add Excel Process Scope in the beginning

yes,I did the same thing which you have mentioned

Are you facing the error or it got resolved?

re-run was successful but I was thinking if it failed again with the same reason then how to resolve it?

Could you please share a screenshot of the code which you have done for multiple excel handling

Following are some of the suggestions I could give

  1. Include Kill Process Excel in the beginning
  2. Add Excel Process Scope
  3. Try to avoid opening another excel within the scope of a different file if it is not mandatory for the solution
  4. Uncheck Keep File Open
  5. While reading the excel using Read Range option - Uncheck only visible rows and select read formatting as Raw value

  1. Kill excel keeping continue error as true after each of the excel operations
  2. Put some delay of 2-3 seconds after completing each of the excel operations