Paul Liebrand's Weblog

Welcome to my blog mainly about SharePoint

Skip to: Content | Sidebar | Footer

Google Search

Document is locked for editing

4 January, 2008 (15:12) | SharePoint | By: Paul Liebrand

At some point in time, you will run into the DocumentName is locked for editing by ‘Username’ message when working with SharePoint. Most of the time, this is a very valid message and is notifying the user that someone else is already editing the document.

 readonly

However, what happens when the message has your name there?  How could this be possible? (On some occasions it will also say unknown.)

When you edit a document, SharePoint registers that you have this document open for editing.  Once every 10 minutes or so, the Office product will check back in with SharePoint letting it know that it is still open by you. Once the document is saved and closed then Office will let SharePoint know that the document is now available to other users.

On some occasions you will receive the locked for editing message with your name there and no matter what you attempt to do you cannot get rid of the message (closing / reopening the document or restarting your computer does nothing to help rectify this).

This situation most commonly occurs under the following scenarios:

  1. The Microsoft Office product crashes while you were working on the document
  2. Computer freezes or crashes while document is open
  3. Lost of network connectivity while document is open

You might be wondering how this could happen if the document is stored in SharePoint?  To understand how this situation can happen, it is helpful to understand how SharePoint and Office work together.

The following is a high level overview of the process:

  1. User clicks Edit in Microsoft Word from the drop down menu in a SharePoint document library
  2. Word launches and tell SharePoint that you have the document open for editing (locked for other users)
  3. A copy of the document is downloaded and stored in a hidden system folder on your local computer. By default, this is located  in:

    C:\Documents and Settings\UserName\Local Settings\Temporary Internet Files\Content.MSO

  4. Under normal circumstances, when you close the Office product, the file is removed from the Content.MSO folder

If someone occurs that prevents the document from cleaning itself up (such as one of the scenarios mentioned previously) it is possible that Office will continue to tell you the file is locked for editing.

The solution to the problem is to simply delete all the files out of the Content.MSO folder and attempt to open the document again from SharePoint.

Prior to deleting the files you may want to copy the files because it is also possible that the version stored on the hard drive is more recent than the one stored in SharePoint — I have seen this on rare occasions.

Update – 4/13/2010

Be sure to check out part 2 of this post the outlines another location you may need to check.


Post to Twitter Post to Delicious Post to Digg Post to Facebook Post to Reddit

  • http://www.paulliebrand.com Paul Liebrand

    The CONTENT.MSO folder is a special hidden folder. You will not see it if you are just looking via Windows Explorer; you have to manually type in Content.MSO into the address bar.

    The quickest way to insure you are in the right folder, do the following:

    1. Start Internet Explorer and click Tools > Internet Options
    2. Click Settings under Browsing History
    3. Click View Files

    This will put you into the Internet Explorer Temporary Internet Files folder. Now simply append Content.MSO to the path listed at the top of the Windows Explorer toolbar.

    Thanks

  • http://liebrand.wordpress.com liebrand

    The CONTENT.MSO folder is a special hidden folder. You will not see it if you are just looking via Windows Explorer; you have to manually type in Content.MSO into the address bar.

    The quickest way to insure you are in the right folder, do the following:

    1. Start Internet Explorer and click Tools > Internet Options
    2. Click Settings under Browsing History
    3. Click View Files

    This will put you into the Internet Explorer Temporary Internet Files folder. Now simply append Content.MSO to the path listed at the top of the Windows Explorer toolbar.

    Thanks

  • Anu

    Hi Paul,
    Tried that (by displaying all the hidded files) but in my machine as well as in our server machine i did not find this folder.

    Is there any other way to solve this?
    Is the URL length an issue for this? as my url of the document what iam trying to open exceeded 256 charecters.
    Iam not sure what the issue is but i want to get rid of this issue ASAP.

    Please help me.

    Thanks in advance.

  • Anu

    Hi Paul,
    Tried that (by displaying all the hidded files) but in my machine as well as in our server machine i did not find this folder.

    Is there any other way to solve this?
    Is the URL length an issue for this? as my url of the document what iam trying to open exceeded 256 charecters.
    Iam not sure what the issue is but i want to get rid of this issue ASAP.

    Please help me.

    Thanks in advance.

  • Anu

    Hi Paul,
    Tried that (by displaying all the hidded files) but in my machine as well as in our server machine i did not find this folder.

    Is there any other way to solve this?
    Is the URL length an issue for this? as my url of the document what iam trying to open exceeded 256 charecters.
    Iam not sure what the issue is but i want to get rid of this issue ASAP.

    Please help me.

    Thanks in advance.

  • http://www.paulliebrand.com Paul Liebrand

    Anu,

    I have never seen a client PC that does NOT have this folder when SharePoint and Office is involved which leads me to believe that either I am not explaining the process clear enough, or there is something odd and strange on your end.

    The folder is not even visible when you tell Windows to show hidden files and folders. You HAVE to manually key it into the address bar in order to show it.

    I have never seen a URL length issue cause this particular problem. I have seen Excel, Word, etc report that the URL is too long if it is too long but not this document is locked for editing issue.

    Generally the locked for editing is caused by a computer crash or a network issue.

  • http://www.paulliebrand.com Paul Liebrand

    Anu,

    I have never seen a client PC that does NOT have this folder when SharePoint and Office is involved which leads me to believe that either I am not explaining the process clear enough, or there is something odd and strange on your end.

    The folder is not even visible when you tell Windows to show hidden files and folders. You HAVE to manually key it into the address bar in order to show it.

    I have never seen a URL length issue cause this particular problem. I have seen Excel, Word, etc report that the URL is too long if it is too long but not this document is locked for editing issue.

    Generally the locked for editing is caused by a computer crash or a network issue.

  • http://liebrand.wordpress.com liebrand

    Anu,

    I have never seen a client PC that does NOT have this folder when SharePoint and Office is involved which leads me to believe that either I am not explaining the process clear enough, or there is something odd and strange on your end.

    The folder is not even visible when you tell Windows to show hidden files and folders. You HAVE to manually key it into the address bar in order to show it.

    I have never seen a URL length issue cause this particular problem. I have seen Excel, Word, etc report that the URL is too long if it is too long but not this document is locked for editing issue.

    Generally the locked for editing is caused by a computer crash or a network issue.

  • http://rue21.com/ TFox

    Suggested work around:
    Have the users save a copy of the file locally. Once they are done making their changes, they can upload the file over the original file. As long as the SP file is checked in, I have had no problems with this work around. Sometime the newly uploaded file will be marked read-only, but the changes are made, saved and can be shared. Sometimes that is enought to make the user happy.

  • http://rue21.com/ TFox

    Suggested work around:
    Have the users save a copy of the file locally. Once they are done making their changes, they can upload the file over the original file. As long as the SP file is checked in, I have had no problems with this work around. Sometime the newly uploaded file will be marked read-only, but the changes are made, saved and can be shared. Sometimes that is enought to make the user happy.

  • http://rue21.com TFox

    Suggested work around:
    Have the users save a copy of the file locally. Once they are done making their changes, they can upload the file over the original file. As long as the SP file is checked in, I have had no problems with this work around. Sometime the newly uploaded file will be marked read-only, but the changes are made, saved and can be shared. Sometimes that is enought to make the user happy.

  • Marlijn

    Hi Paul,
    In our company, users are locked from documents by themselves on a regular basis. I've tried to delete the file from the Content.MSO-folder, but they still get the warning/error… I feel I've looked everywhere, but can't find an answer… Do you have any other ideas???

    Grtz. Marlijn

  • Velmurugan

    Hi, In our company sharepoint server having lot of folders & files and many users are checked out and forget it. How to find all the checked out files from various folder in simple way in admin level.
    Or HOw to list out all the checked files from sharepoint?

    Thanks in advance,
    Velmurugan,

  • http://www.paulliebrand.com Paul Liebrand

    You can run this SQL statement against your content database to get a list of items that are checked out:

    SELECT AllUserData.tp_DirName,
    AllUserData.tp_DirName,
    AllUserData.tp_LeafName,
    CASE
    WHEN AllUserData.tp_ContentType = 'Item'
    THEN
    AllUserData.tp_DirName
    + '/DispForm.aspx?ID='
    + AllUserData.tp_LeafName
    ELSE
    AllUserData.tp_DirName
    + '/'
    + AllUserData.tp_LeafName
    END
    AS Link,
    AllUserData.tp_ContentType,
    AllUserData.nvarchar1,
    AllUserData.nvarchar2,
    AllUserData.tp_ModerationStatus,
    AllUserData.tp_DeleteTransactionId,
    AllUserData.tp_IsCurrent
    FROM AllUserData AllUserData
    WHERE (AllUserData.tp_ModerationStatus = 2)
    AND (AllUserData.tp_DeleteTransactionId = 0×0)
    AND (AllUserData.tp_IsCurrent = 1)
    ORDER BY AllUserData.tp_DirName, AllUserData.tp_LeafName

    I hope this helps.

    Paul

  • Velmurugan

    I ran this query. Please let me know how to find out the checked out files.
    I am new to sharepoint server. please explain in detail.

  • http://www.paulliebrand.com Paul Liebrand

    You need to connect to your SharePoint SQL database using something like SQL Management Studio and the run the query I provided against that database.

    Are you running just WSS or MOSS?

  • velmurugan

    I have run sql query in SQL Management Studio 2005 and we are using MOSS.

  • http://www.paulliebrand.com Paul Liebrand

    I am confused. The query I provided above should give you a listing of all items considered to be checked out. Are you saying the query did not work?

  • velmurugan

    Query is successful running.afterthat how to find all the checked out files.i am new in sharepoint server.please help me.

  • reddogaw

    Hi Paul,

    I also need to overcome one of these locks… We have an InfoPath application, and we've written a custom webservice to pull out meta data and write it to our document library (as well as deal with checkin/out problems etc). This works fine…

    Until: our client has the WebClient windows service active (to enable webdav etc) then open a saved InfoPath file. This makes the client put a lock on the file… Which means on subsequent saves, our file is totally locked out from our custom webservice (which is also executing as a different user – with write/undo check out/contributor rights in SharePoint).

    Any ideas how to:
    * Override the lock security?
    * Undo the lock security (e.g. undo checkout)?

    We are using WSS3.0. And our webservice is communicating using the WSS3.0 Web Services rather than the object model…

  • reddogaw

    Hi Paul,

    I also need to overcome one of these locks… We have an InfoPath application, and we've written a custom webservice to pull out meta data and write it to our document library (as well as deal with checkin/out problems etc). This works fine…

    Until: our client has the WebClient windows service active (to enable webdav etc) then open a saved InfoPath file. This makes the client put a lock on the file… Which means on subsequent saves, our file is totally locked out from our custom webservice (which is also executing as a different user – with write/undo check out/contributor rights in SharePoint).

    Any ideas how to:
    * Override the lock security?
    * Undo the lock security (e.g. undo checkout)?

    We are using WSS3.0. And our webservice is communicating using the WSS3.0 Web Services rather than the object model…

  • Peter Martin

    Paul – I am trying to upload some files that I colleague who used to work here had from 2008. I'm getting the locked message on about half of his files. The file names are not in SharePoint because I've added a “final” to the end of them. Any ideas what's causing the lock message?
    Thanks, Peter

  • http://www.paulliebrand.com Paul Liebrand

    Are you sure it is related? Perhaps you are suffering from the “special” character issue. http://support.microsoft.com/kb/905231

  • Mark P

    Hi Paul,

    I'm not sure if you can help, due to internal policies and procedures, the fix involving the network cards is not an option for us. do you know of any way to eliminate the lock time out, or reduce it to for example 1 minute?

    All the best

    Mark P

  • http://www.paulliebrand.com Paul Liebrand

    Mark,

    Unfortunately I do not believe the is a way to eliminate the lock time out or reduce it. I have found no reference to any setting that can modify this behavior. Perhaps forcing your users to checkout the document to the local drafts folder can be an option to work around the issue.

    Paul

  • Pingback: Document Locked Mystery « SharePoint From Scratch

  • Matt Hancock

    This was a big help!! Thanks for the information.

  • Smith

    Thanks for the explaination. If you are trying to justify bad design in Sharepoint though, I am not buying it. They are not reason you have given, they are excuses for bad design. This simply should not happen, and if it has to happen (which I doubt) at least check if it is the same user and allow the user to override the warning. You simply cannot justify this type of poor behaviour other than to say it wasn’t well thought out in the first place or we didn’t have time to fix it…

  • Pingback: User cannot check-out a Document « SharePoint Slade

  • Pingback: Short Term Document Locks « Sladescross's Blog

  • Pingback: Real world SharePoint 2010 deployment issues | The SharePoint Grind

  • Pingback: CodeHolio.Net | Troubleshooting “Document is locked for editing by <domain><username>” Error Message

  • Pingback: CodeHolio.Net | Troubleshooting “Document is locked for editing by <domain><username>” Error Message