A lot of articles exist on the internet on how to deal with this issue so you will be wondering why i still bother to expend energy on the topic.
Well, this wouldn't have been necessary if these articles i mentioned actually addressed the issue i had today while trying to achieve something that should have been very easy to do - Delete a file from a Document Library.
It happened that the colleague i assigned to upload a form (word document) for download by all staff within the organisation gave everyone permissions to upload and download documents in the library - whoosh!!.
As you would guess, some persons played around with the original documents, leaving his details on the form and refusing to close the form on his client. In the end the document was locked and i could not check it out or even delete it to enable me upload a fresh one. I was stuck. I was embarrassed.
What Things Did I Try?
Internet Surfing:
Well, i searched around the net for ways to override checkout.Some article suggested that the lock will resolve itself after 10 minutes. 30 minutes and several user complaints later , issue was still there. It turned out that this works in 80 % of cases where the Short Term lock feature in Microsoft Office Clients actually renews itself every 10 minutes.
Others suggested Powershell route and i tried the scripts. File was still locked. The scripts must have worked in some scenarios as suggested by comments trailing the posts.
http://www.sharepointdiary.com/2014/12/the-file-FILEURL-is-locked-for-exclusive-user-by-USER.html
https://pholpar.wordpress.com/2014/04/03/how-to-use-powershell-to-delete-short-term-locks-from-documents-opened-from-sharepoint/
Some gave out .NET codes
http://www.codeproject.com/Articles/251161/Resolve-SharePoint-Document-Locked-for-Editing-Iss
3rd party tools: Truth is, i don't experiment with unsigned and untested tools on my production environment
http://think4code.blogspot.com.ng/2012/07/sharepoint-2010-file-is-locked-for.html
Social Engineering:
I picked up the username of the user (this is easily visible in the error popup) that had the document locked and called him. He swore by his ancestry that all his word documents were closed. Promised he will see what he could do. I moved on.
Other Things i tried:
- Reduced permission level of everyone on the document library.
- Tried to knock the user out with an IIS reset (desperate me). The locking actually information actually exists within the content database so this surely failed.
Made Coffee:
Not worth a place in this article.Why was my Case Different?
Well, maybe because the document was an older version word document (.doc) which does not allow for Co-authoring on SharePoint.The article below pointed me in that direction
http://sharepoint-community.net/profiles/blogs/sharepoint-2013-multi-authoring-this-file-is-locked-for-editing
The next things i did quite simply resolved the issue for me
From the Document Library
1. Adjust Library Settings
- Go to Library settings
- Version Settings
- Under Document Version History, select No versioning
- Under Require Checkout, select Yes
- Click OK
- From the Library, Go To Advanced Settings
- Under Open Documents in Browser, select second option (Open in browser)
- click OK
It should work.
Delete document afterwards