Forum Discussion

ngocdiepdo's avatar
ngocdiepdo
Copper Contributor
Jun 29, 2022

Microsoft.SharePoint.SPFileLockException

I am building a tool to upload the data to Microsoft Sharepoint excel file. There are many users who can use the file at the same time, but it is critical for me to be able to upload the data to the particular worksheet in that specific file all the time. However it seems that when the file is used by other users I cannot do the updates to the file and I am getting this error: 

'{"error":{"code":"-2147018894, Microsoft.SharePoint.SPFileLockException","message":{"lang":"en-US","value":"The file XXX.xlsx is locked for shared use by email address removed for privacy reasons [membership]."}}}'

Is there a way for me to force an update to the file? To remove this Lock exception?

3 Replies

  • ingeLLa's avatar
    ingeLLa
    Brass Contributor

    This is probably not a solution, just an input from a scenario where we had a problem with an Excel sheet that more than 50 people used constantly. It's been a while since I've been digging around, but I remember how I solved it.

    Scanario: 50 people work every day in a really heavy Excel sheet with many tabs and lots of formulas. They all wanted to be able to open the document and enter their own numbers without saving them, but always know that they had the latest version.

    Two people updated the Excel sheet.

    Problem: users didn't see updates

    In order to be able to modify, they needed to open the document from their computer, as online didn't allow changes without saving.

    After a lot of testing, it ended up that many versions seemed to be the problem.

    Solution:

    Created a separate document library in SharePoint, on the same site, with just this document. Turned off version history (now I'm not sure, maybe I set it to two versions.... it was a while ago).

     

    But haven't heard anything from the company since then, which is always a good sign 😉

    • ingeLLa's avatar
      ingeLLa
      Brass Contributor

      Maybe I should have posted my answer here, see my answer in the whole thread. 🌸