File is locked for editing by ‘domain\username' when editing office document in SharePoint site
Introduction
The file is locked for editing by ‘domain\username' when editing Office document in SharePoint site.
Issue
Sometimes, when we try to edit a document uploaded on SharePoint, we get a file locked error: “File is locked for editing by ‘domain\username’ “, even though the file has been checked in and no one else is editing the file.
Cause
Usually a file is locked by WSS when a particular user has ‘checked out’ the file for editing purposes. A write lock is created so that no other user can edit this file simultaneously. There can be numerous reasons for this. Below are the some of the reasons:
System crashes while the file is still open.
The file has been closed unexpectedly.
Check in was not successful.
Network connection is lost while the file is still open.
Make sure to check the below to resolve the issue.
Check whether the file has been properly checked in or not. If not, refresh the page and try to check in the file again.
Delete the local copy of the file present in the cache folder of the concerned user account (access to user’s PC required).
Close all the instances of file type opened in the system. E.g. if the file type is excel, then close all the excel files currently opened.
Also, kill the file type service (excel in this case) using the task manager.
Solution
Please follow the below-mentioned resolutions if issue still exists.
- Download the wsp from the site: https://spunlockfiles.codeplex.com/
- Upload it to the site collection solution gallery
- Activate the solution from solution gallery
- Activate the solution at the site collection level
- Add the web part named as “spfileunlock” to any page and Try to check the issue again.
Note: If you find a different solution, please report it as a comment to this post. This will be useful to the SharePoint Community. Be sure to double-verify it: undo your solution and verify that the problem comes back, then redo it and verify that the problem goes away.