The file is currently checked out or locked for editing by another user Sharepoint
The file is currently checked out or locked for editing by another user
It shows something like
File in Use
myfile.xlsm is locked for editing
Open ‘Read-Only’ or click ‘Notify’ to open read-only and receive notification
when the document is no longer in use
Or UPLOAD FAILED this file is locked for editing by domain\usrename
The problem is, nobody else is editing this document, and the identified user (‘domainname\yourname’) is the name of the current user (the person opening the document right now) and sometime it shows other user name who editing earlier or editing currently
To release the locks from below script, go to your SharePoint server and execute the following script, you need to change site URL, relative URL of File in two place, This is “Ram Ban Oshdhi “ 100% fix the issue and will get your file unlock
Change the Site URL, Relative fiel URL and full file URL.
What can be caused?
- Word previously quit improperly and, therefore, did not delete the owner file. -or-
- A second instance of Word is running in the background with the document already open. -or-
- The document is shared over a network, and another user has it open. From my personal experience, I’ve found a combination of the first and third point above can recreate this error quite constantly
- The Microsoft Office products cashes while you were working on that particular document
- PC crashes while the document is open
- Loss of network connection (network issue) while document is open and your session is still live with editing mode
- If you have the preview pane turned on in Windows 7’s Explorer, you will get this error. Turning off the preview pane worked for me.
- Another case might be is like if first user with the file open is on Excel 2010; the second user is on Excel 2013 or any other version; perhaps there’s some incompatibility which causes the second user’s Excel to be unable to get the real name.KB2598143 for Office 2010 (different packs for 32 and 64 bits!) to fix the incorrect names in the message.
- If user maps to a network share on our SAN. And you run a terminal server with Office installed that utilizes the same network share on our SAN. If an end user is using an Office product, and then does not log off completely but rather X out, the the file is shown as locked by the person who installed Office on the terminal server
Change the Site URL, Relative fiel URL and full file URL. ## Add SP Snapins Add-PSSnapin Microsoft.SharePoint.PowerShell ## Get your Web Object $myWeb = Get-SPWeb https://collab.panasonicautomotive.com/sc10 ## Get your file that currently behaving strange “Relative URL” , copy URL including special char to replace Space $myFile = $myWeb.GetFile("Executive%20Weekly%20Reports/Mar%2027%2C%202017.docx") $myUserID = $myFile.LockedByUser.ID $myUser = $myWeb.AllUsers.GetByID($myUserID) ##The following is the all-important piece, open the site as the user who locked the file and then release the lock $impSite= New-Object Microsoft.SharePoint.SPSite($myWeb.Url, $myUser.UserToken); $impWeb = $impSite.OpenWeb() ## Get your full file reference in the given format, copy URL including special char to replace Space $fileURL = "https://mycompanysitename.com/sc10/Executive%20Weekly%20Reports/Mar%2027%2C%202017.docx" $impFile = $impweb.GetFile($fileURL) $impFile.ReleaseLock($myFile.LockId)