The file Document.docx is locked for shared use by user in SharePoint

It is time for a classic SharePain today.

Locked for shared use

You open a document in Office online and edit the document. Then you try to rename is and you get the following error message:

The file “Document.docx” is locked for shared use by username@tenant.onmicrosoft.com

I tried the same by renaming the file in the modern experience

 

When you try to open the document in word things just disappear in a black hole and Word is never opened.

After about 30 minutes my word suddenly opens the document as the lock seems to have expired now.

There seems to be an issue with document being locked when you open a document with Office Online

I haven’t got a real solution yet. If you do then please let me know. Otherwise watch this space as I’m still investigating.

 

Possible solution

Thanks to Olivier Collet for pointing out the following solutions on TechCommunity

  1. Make sure the “webclient service” on client side is running
  2. Find registry key: HKLM\SYSTEM\CurrentControlSet\Services\WebClient\Parameters on their machines.
  3. Find value: SupportLocking(if no, please add), set its value to 0, want to just disable lock feature.

 

 

 

 

Share
Pieter Veenstra

Business Applications Microsoft MVP working as the Head of Power Platform at Vantage 365. You can contact me using contact@sharepains.com

View Comments

    • Hi Noel,
      That solution would only work in on-premises environments. I don't think that the unlock is available within CSOM. Also I'm not sure if this is something that I could get end users to do every time they edit a document in Office Online.

  • Saw this today on two different tenants.
    Once as a flow had finished doing its thing the other when I created a brand ne document online using the new button.

    Definitely a bug has surfaced here

  • It somestimes happened to me, re opening the doc in teams or word, then close docs & teams again, that fixed the issue

  • When this happens I enforce checkout on the library so I can check out, edit and check in. Removing enforce check out on the library then leaves it all working as normal. This solution is ok in a training environment as its great for demonstrating the differences between libraries with and without enforced checkout but don't think its a real world work around.

    • In your case does the document remain checked out? In my case the document is not checked out. It is just locked after it was edited in office online.

      • Pieter, the document is not and never has been checked out, just locked as you described. When this happens I then enforce Check Out on the library and the document is not shown as checked out. I can check it out and edit. The action of enforcing check out on the library seems to force SharePoint Online to realise the document is not actually locked in any way.

        I normally see this on training courses when creating a new document in SharePoint Online and after closing the document try to edit the properties. So the document is brand new. It seems to take between 30 mins and 24hrs to release the lock for me, unless I change the library settings as described. However I've only found this check out solution on a course last week and it worked again this week - twice isn't really proof of a solid solution.

  • Same here - started on Friday. Logged a support request with MS but even though I've given then step by step screenshots of how the error is caused, they insist on remotely accessing my computer before they'll try to fix it. Which given I'm on a Mac is causing them problems…

    The different in my case is that I'm able to edit and view files, despite the lock, just not rename them, delete them, etc

    • I have the feeling that it is getting worse. Any document created in office online cannot be edited within the next 30 minutes ot so

  • Hi Peter, I had similar problems like you describe. When we click new document on a library and it opens it in Office Online, you rename the document and afterwards would like to set some required meta data in the library itself, we get same error message that document is locked by yourself. We managed to 'fix' this by setting the following attributes on the library trough PnP provisioning: EnableVersioning="true" EnableMinorVersions="true" MinorVersionLimit="100" MaxVersionLimit="500" DraftVersionVisibility="0". Setting these options doesn't lock the file anymore.

    Maybe this will give you some new insights or help you out.

    • Hi Robert, I think that that is similar to Sara's comments. I have the feeling that something has changed to the out of the box library or Office Online is not able to deal with out of the box settings. Either way this should be fixed.

      I've reported this to Microsoft on twitter, but I'm still waiting for them to resolve the issue. I'm hesitant changing out of the box library settings as a workaround.
      https://twitter.com/PieterVeenstra/status/1009037750543233024

      I wonder if this is related to the changes currently made to document libraries and Office Online is assuming new settings.

  • Hi,
    we have about 100 users who work's online in SharePoint libraries. Many of us has this locked problems, even me admin. We have a case and Microsoft India is working on this huge problem.
    When a user open a document, edit it=locked by himself
    He can't rename, delete, move or copy it for about 1-24 h
    When you open it in desktop Word, you can see that is locked by myself, sometimes 2, 3 or more instances of the same user or other users.
    It is a huge issue for us in our organisation and we need help NOW. Users are frustrating, and Microsoft tells us every second day to wait, "we are working on a solution".....

  • MS SharePoint Online Team have finally updated the new version of SQL Tables and modified release times in the code(error 500 via https request).
    Info:
    HTTP/1.1 423 Locked
    Cache-Control: private, max-age=0
    Transfer-Encoding: chunked
    Strict-Transport-Security: max-age=31536000
    X-FRAME-OPTIONS: SAMEORIGIN
    X-Powered-By: ASP.NET
    MicrosoftSharePointTeamServices: 16.0.0.7806
    X-Content-Type-Options: nosniff
    X-MS-InvokeApp: 1; RequireReadOnly

    We have tested our SharePoint libraries via different users and verified Connection to SharePoint Online via software Fiddler Web Debugger.

    Everything seems OK, all users can copy, rename, move, edit same file over again also...

  • Peter:

    Did you ever resolve this? This happened to me with a document last month. A month passed, and I still cannot rename the document because it is "locked by another user" but the other user's email address is my own.

    • Hi Francis,
      I found that when the locks last longer than a day that there were often background processes ( like Flow, SharePoint Workflows, PowerShell or anything else locking the files). i would be interested to see the version history on this document that is locked. Are you able to email that to me?

    • Hi Per,
      I am suspecting background processes or forgotten locks but I havent been able to find an cause for it. Badly designed Flows or PowerShell script can cause these problems.
      Do you have any background processes running?

Recent Posts

Introducing 8 AI Functions for Dataverse in Power Apps

Recently Microsoft added AI Functions to Dataverse that can be used in Power Apps. In…

24 hours ago

Copy and paste Scope steps in the new Power Automate Designer

One of the outstanding issues with the new Power Automate Designer is Copy and Paste…

1 week ago

Receive the available storage within your SharePoint Online tenant

Within the SharePoint admin centre there is that little detailed overview, telling you the available…

4 weeks ago

Options for Documenting Your Power Apps: Comments, Code, and Controls

Within Power Apps there are various ways to document your app. In this post I'm…

1 month ago

2 ways to duplicate SharePoint Lists to support your Power Apps

Recently I've been asked quite a few times to duplicate SharePoint lists as part of…

1 month ago

Update a Hyperlink Column in SharePoint with Power Automate

Today, I was asked about how to create a lookup to a document or item…

1 month ago