The frustration of seeing "The resource you are attempting to access is locked" on OneDrive can be real. This error message often occurs when you're trying to access a file or folder, but OneDrive is unable to grant you permission.
One common reason for this issue is that the file or folder is currently being edited by another user. This can happen when multiple people are working on the same document or folder simultaneously.
Another reason could be that the file or folder is in use by the system itself, perhaps due to a pending sync or update. This can cause OneDrive to lock the resource, preventing you from accessing it.
If you're experiencing this issue, it's a good idea to check if anyone else is currently editing the file or folder, and try accessing it again after they've finished.
Understanding the Issue
The "OneDrive the resource you are attempting to access is locked" error can be frustrating, but understanding the issue is key to resolving it.
This error often occurs due to a file being locked by another user or process.
You might be trying to access a file that someone else has opened in edit mode, or a program has taken a lock on the file.
OneDrive's syncing mechanism can also cause issues, especially if you're working with large files or multiple users.
If you're trying to access a file that's been shared with you, check the permissions and make sure you have the necessary access rights.
The error message might also indicate that the file is being used by another process or program, so it's worth checking your computer's task manager to see if there's a program taking up system resources.
Solution 1: Loop Until File Is Released
If you're experiencing issues with a locked OneDrive file, Solution 1 is a clever workaround.
An Excel file will become unlocked up to 10 minutes after the file is closed, making it a viable option to wait it out.
To implement this solution, incorporate a loop into your flow that checks when the file is unlocked and finish updating the file properties.
Configure the Run After settings for the Condition action to ensure the flow continues to run whether the update file properties action succeeded or failed.
The condition action checks the update file properties outputs for status code 400, which means the file was locked for shared use.
If the file was locked for shared use, the flow will delay for 30 seconds before it goes back to the start of the loop.
Otherwise, the loop will end, and you can proceed with updating the file properties.
Alternative Solutions
If you're experiencing issues with files being locked in OneDrive, there are alternative solutions you can try.
One approach is to create a copy of the file, which can help avoid file locks altogether. This method is mentioned in the article as an "unconventional method" that can be used.
Another option is to delete the file and restore it, which can also resolve file lock issues. However, be sure to roll back to a previous version if needed, to avoid data loss.
A simpler solution is to enable content approval and then disable it afterward. This method can also help resolve file lock issues.
In some cases, the issue may be due to a user's file being locked for shared use, in which case you can try deleting the user's sharing permissions and see if that resolves the issue.
If the file is locked by a user who is not online, you can try removing their sharing permissions, which may automatically remove the lock after a short while.
If you're experiencing file locks with Document Sets, you may need to try a different approach, such as using a different workflow or editing method.
If you're using SharePoint Designer workflows, you may need to configure the Run After settings for the Condition action to ensure the flow continues to run whether the update file properties action succeeded or failed.
In some cases, the issue may be due to the file being locked for exclusive use, rather than co-authoring. This can be a problem when opening files from a Power App link, for example.
Here are some possible reasons why Office uses exclusive file locks over co-authoring locks:
- Status code 400 means the file was locked for shared use.
- If the file was locked for shared use, the flow will delay for 30 seconds before going back to the start of the loop.
- If the file was not locked for shared use, the loop will end.
Frequently Asked Questions
How do I remove the lock from OneDrive files?
To remove the lock from OneDrive files, unlink any connected Office 365 accounts, including personal OneDrive, from the OneDrive sync client settings. This will allow you to access and manage your files without any restrictions.
Sources
- https://www.makeuseof.com/how-to-fix-cant-delete-file-in-onedrive/
- https://www.matthewdevaney.com/4-solutions-for-excel-file-is-locked-error-in-power-automate/
- https://golayer.io/blog/excel/excel-locked-for-editing-by-me/
- https://www.mrsharepoint.guru/sharepoint-unlock-file/
- https://www.easeus.com/backup-recovery/fix-onedrive-error-0x8007016a.html
Featured Images: pexels.com