Solution for "The file [filename] is locked for exclusive use by [account-name]"
An option should be added to the "FILES" tab (when a document is selected) to unlock a document that "is locked for exclusive use by [user]"
As advised by O365 support, currently the only workaround is to download a copy and re-upload.
North Gork commented
@Al Connelly I wrote an application page that uses the SharePoint API to unlock a document if it is an "Exclusive" file lock or a "Shared" file lock. I assume a "Shared" file lock is what you mean by "co-authoring" file lock?
Even after unlocking the file via the SharePoint API, the file is still locked so I suspect the lock is in the Office cache on the client machine. Perhaps in the windows cache too but locked on the client machine as a result of some authentication between Office and SharePoint that does not work properly.
Nitin Jain commented
This is killing me with no solution...
Ryan Helmer commented
We really need a way administratively to unlock a file. Telling users they have to wait for an arbitrary timeout period is definitely not well-received.
The problem could also be because of reaching the limit of minor versions (511).
Step 1: Publish a major version and check if that didn't solve the issue then try Step 2.
Step 2: Download a copy and upload it again that will solve the issue as it solved for me.
Al Connelly commented
This is likely already going to be fixed with improvements to coauthoring. there are two different lock states that can be set for a file hosted in SharePoint: an Exclusive file lock, and a Co-authoring file lock. Whoever opens the file sets the lock state. Exclusive locks are set by users who either can't use modern co-authoring (Like opening an Excel file using Office 2016 MSI instead of Click to run on the monthly channel) or using File check out. SharePoint sets the lock state and releases the lock state once it hears back from the Office client that whoever opened the file has closed out of it and the file is no longer in use. If SharePoint never hears back from the office client, then SharePoint won't unlock the file. In that case, SharePoint will remove the lock once the User's session expires (Usually a couple of hours at most). When a co-authoring lock is set, any user who can co-author can access the file without issue. The first user (who can co-author) sets the co-author lock state. The lock will also include that user's user session ID generated by SharePoint. Any other user who opens the file to co-author will have their session ID added to the file's co-authoring look, ultimately saying "Hey! I'm in this file too!". Only when all users leave the file will the co-authoring lock be released. The "The file [filename] is locked for exclusive use by [account-name]" message is expected behavior. What should be addressed is reliable having SharePoint receive the "I'm done with the file!" call from the Office client so it properly unlocks the file.
Tom Castiglia commented
Its pretty embarrassing that this is still a common problem for so many SharePoint users.
It's my first word file upload and it's locked. So frustrating :(
Django Lohn commented
Very nasty hidden feature... when someone opens Word Online by mistake (because that is default for libraries) the file is locked blocking all kind of workflows and edits!
Raymond Ang commented
Yes please, we have people who go on vacation and might have unsaved other documents. Force restarts will cause them to loose even more work. PowerShell was able to force this previously on-prem, but PowerShell for SharePoint online does not.
is this still on hold ? or any work around solution available?
Marc Wenning commented
yeah a way to unlock a locked document would be very helpful, we run into this and users dont like having to wait for SharePoint to release the lock on its own.
Matt Groves commented
At the very least an option to unlock via CSOM or SPD is needed.