In Power Automate, workflows often interact with files stored in SharePoint, OneDrive, Dataverse, or external storage services. A common issue users face is the “File Locked by Another User” error, which occurs when a flow tries to access a file that is currently open or in use by another process.
Error Message Example:
“The file is locked for editing by another user or process.”
This guide explains:
Why the file lock error occurs.
How to diagnose the issue.
How to fix and prevent file locking errors in Power Automate.
Step 1: Understanding Common Causes of the “File Locked by Another User” Error
Cause | Description |
---|---|
File open in another application | The file is currently open in Word, Excel, or another program. |
Another user is editing the file | A user is actively making changes to the file. |
Multiple flow instances accessing the file | More than one Power Automate flow is trying to edit the file at the same time. |
Syncing issues with OneDrive or SharePoint | The file is being updated or synced, causing a temporary lock. |
Check-in/check-out restrictions in SharePoint | The file is checked out and locked for editing by a specific user. |
A previous flow run has not released the file | A prior instance of the flow still has the file open. |
Step 2: Diagnosing the Issue
2.1. Check the Flow Run History
- Open Power Automate (https://make.powerautomate.com).
- Click on My Flows → Select the affected flow.
- Go to Run History → Open a failed run.
- Look for an error message like:
The file is locked for editing by another user or process.
- Expand the action details to check:
- Which file is causing the issue.
- Which user or process has locked the file (if shown).
Step 3: Fixing the “File Locked by Another User” Error
3.1. Ensure No One Has the File Open
Problem: A user has the file open in an application like Word, Excel, or PowerPoint.
Solution:
- Ask the user to close the file.
- If the file is open in Excel Online or SharePoint, ensure it is not in “Edit” mode.
- Use the “Co-Authoring” feature in Office 365 to allow multiple users to edit at the same time.
3.2. Close Open Applications Holding the File
Problem: A local application (e.g., Excel) is preventing access.
Solution:
- Ask users to save and close the file.
- If necessary, restart the user’s computer to release the lock.
- Check for background processes that might be holding the file (e.g., Excel.exe, Word.exe).
- On Windows, open Task Manager → End task for Excel.exe or Word.exe.
3.3. Implement a Delay Before Accessing the File
Problem: The file is temporarily locked due to a previous action in the flow.
Solution:
- Add a “Delay” action in Power Automate before performing file operations.
- Example:
- Click “New Step” → Search for “Delay” action.
- Set the delay to 30-60 seconds.
- This gives the system time to release the lock before continuing.
3.4. Ensure No Other Flow is Accessing the File at the Same Time
Problem: Multiple flows are trying to edit the same file simultaneously.
Solution:
- Check other flows that may be using the same file.
- Use the “Concurrency Control” setting:
- Open the flow.
- Click on the trigger action (e.g., “When a file is modified in SharePoint”).
- Click on “Settings”.
- Set “Concurrency Control” to “Off” to ensure only one instance runs at a time.
3.5. Use a Temporary Copy Instead of Editing the Locked File
Problem: The flow needs to modify a locked file.
Solution:
- Instead of editing the locked file, create a temporary copy and work with it.
- Steps:
- Use “Get file content” to retrieve the file.
- Use “Create file” to save it as a new copy.
- Modify the new copy instead of the original.
- (Optional) Replace the original file after processing.
3.6. Enable SharePoint Co-Authoring (If Applicable)
Problem: SharePoint is restricting simultaneous edits.
Solution:
- Ensure “Require check-out” is disabled:
- Go to the SharePoint Document Library.
- Click Library Settings → Versioning Settings.
- Set “Require documents to be checked out before they can be edited?” to No.
3.7. Check and Release SharePoint Check-Out Locks
Problem: The file is checked out and locked for editing.
Solution:
- To release a checked-out file:
- Open SharePoint.
- Find the file → Click …” (More Options) → Check In or Discard Check Out.
- If the file is locked by another user, an administrator may need to force check-in the file.
3.8. Implement Automatic Retry for File Actions
Problem: The file is locked temporarily but will be available soon.
Solution:
- Use “Configure Run After” settings in Power Automate:
- Click the failed action.
- Click “…” → “Configure Run After”.
- Set it to retry if the file is locked.
- Alternatively, use the “Retry Policy” setting to retry after a few seconds.
Step 4: Preventing Future “File Locked” Errors
4.1. Best Practices to Avoid File Locking Issues
✅ Encourage users to close files after editing.
✅ Use co-authoring for SharePoint files instead of requiring check-in/check-out.
✅ Avoid multiple flows accessing the same file at the same time.
✅ Use temporary copies for editing instead of modifying the locked file.
✅ Set up automatic retries in Power Automate for locked files.
Step 5: Set Up Alerts for File Lock Errors
- Open Power Automate → My Flows.
- Click Edit Flow → Add a “Send an email” action if a file lock error occurs.
- Configure the email to alert users about the locked file and suggest closing it.