Hello everyone, I’m facing an issue where my UiPath automation fails with a file-locked error when trying to read or write to an Excel file that is sometimes being used by another process or user at the same time. Because of this, the job stops or keeps retrying without success. I want to design the workflow in a way that can handle this situation gracefully, either by waiting and retrying safely or by using an alternative approach so the process does not fail. Has anyone faced a similar scenario in real projects, and what is the best practice to handle Excel file-locked issues in UiPath?
This is common in production. Best practice is to avoid working directly on a shared Excel. Either copy the file to a temp location and work on the copy, or write output to a new versioned file. If the same file must be updated, check if it is locked and implement a wait-and-retry loop with a max timeout. This way the process handles file locks gracefully instead of failing.
Thanks & Have Automation
1 Like
Follow this steps
- Copy the Excel file to a local/temp folder (Copy File)
- Perform all read/write operations on the copied file
- (Optional) Upload or replace the original file after completion
Cheers
If this solution works for you please mark as solved so thread will be closed
Hi @Maheep_Tiwari,
This worked. Thnks for the solution
1 Like
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.