Australian cloud for business software — built and run in Sydney since 2002

NetLeverage
NetLeverage

Word "The document is locked for editing by another user" on SharePoint or a file share

Technical article
Troubleshooting

About this article: This article is reviewed against the cited sources. This is source research, not lab validation. Check the stated versions and your own requirements before making changes.

Word shows this message when it finds that an owner file for the document already exists. Microsoft gives three reasons: Word quit improperly last time and did not delete the owner file, a second instance of Word is still running in the background with the document open, or the document is on a network and another user has it open. On SharePoint there is a fourth, covered below: someone, including you, checked the document out.

Find out who holds it first. If a real user has it open, open it read-only or ask them to finish. Remove the owner file only when nobody has the document open. Microsoft's pages cover Word. They do not cover Excel or PowerPoint, so this applies to Word documents.

What the error means

Microsoft's owner-file page gives the message as: "The document file name is locked for editing by another user. To open a read-only copy of his document, click...", where "file name" is the name of the document. It says "Word creates an owner file when you open a previously saved Word document. An owner file is temporary and holds the logon name of the person who opens the document."

The owner file sits in the same folder as the document. Microsoft's page: its name "begins with a tilde (~), followed by a dollar sign ($), followed by the remainder of the document file name." The example is that the owner file for Document.doc is ~$cument.doc. The page's example uses a .doc file, and it does not give a form for other extensions.

A second Microsoft page, "Unlock my document for editing", says: "Current versions of Word let you edit collaboratively with another user. However there are times when you'll get a "locked by another user" error." It lists causes such as "someone (including you) checking out a document on SharePoint rather than just opening it, using an earlier version of Word, or having a crash while you have a document open."

A third page covers a narrow case: Word 2016 with files stored on SharePoint 2013 shows "Upload Failed: Locked by another user", with the text "Your changes were saved but could not be uploaded because this file is locked for editing by < user >." Microsoft says this was fixed by an update released on October 13, 2015 (KB2920679), and it also describes a registry value and a cache rename. The page says the procedure "will cause you to lose all local changes" and recommends saving a local copy of all pending files first; it also says "By renaming the folder, you preserve document data."

Likely causes

Cause What you see How to confirm
The other user is you, on another device The name in the message is yours Look for the document open on the other device
An earlier crash left the owner file No one has the file open, the message persists Nobody has the file open; an owner file starting ~$ is in the folder
A second Word instance is running Message appears right after a crash or close Task Manager shows more than one WINWORD.EXE
A real user has it open on the network The message shows another user's name Ask them; on a Windows file server, list open handles
Checked out in a SharePoint library The document was checked out rather than just being open Look at the library's check-out status
An older Word version without co-authoring Another user opens the document in an earlier Word Ask which Word they use

Prove the cause before changing anything

All of these are read-only.

  1. Read the user name in the message. If it is the signed-in user, close the document on the other device where it is open. Microsoft's page: "Close the documents on the other device where you have it open."
  2. If it is someone else, contact them and ask whether they have it open. Microsoft's page says to confirm that another user on the network does not have the document open before you do anything else.
  3. In a SharePoint library, check whether the document is checked out. Microsoft's page names checking out as a cause and points to its check-out and check-in page.
  4. In the folder that holds the document, look for the owner file, using the naming rule above. Do not delete it yet.

Example (illustrative): at contoso.com.au, Aroha opens \\fs01\Finance\Document.doc and Word says it is locked for editing by another user, naming Aroha herself. Her laptop crashed last night while the file was open. A look at Task Manager shows no WINWORD.EXE running on her laptop, and the other staff in Finance say they do not have the file open. The folder holds an owner file for the document, which Microsoft's page names ~$cument.doc for Document.doc. Nobody holds the document, so the owner file is a leftover.

Fix

If the lock is yours

Close the document on the other device. Microsoft also says you can edit a copy and then use Save as to overwrite the original file, and that if the lock is from an earlier crash, rebooting the computer to clear it is worth trying.

If someone else has it

Microsoft's page lists the options: ask the other user to check the document in; ask them to open it in a version of Word where you can collaborate (the document may need to be shared); or edit a copy and reconcile the differences later.

If it is a leftover owner file

This section applies to a document in a folder, on a file share or a synced folder; for a document in a SharePoint library, use the check-in step above. If Task Manager shows no WINWORD.EXE running, go straight to the owner file below. If it does, first save your own work in any program you are about to close, and note the document's file name and folder.

Disruptive step: the next steps end every WINWORD.EXE process you select on the computer. Any unsaved Word document in those processes is lost. On a computer that several people use at once, other people's Word processes appear in the same list, so end only your own.

  1. Save all your work, then quit all programs.
  2. Press Ctrl+Alt+Delete, start Task Manager and select the Processes tab.
  3. Select Winword.exe, select End Process, and select Yes in the warning. Repeat for each occurrence of Winword.exe.
  4. Exit Task Manager.

To undo it: there is no way back from ending a process. Start Word again and open the document.

Before you delete the owner file, copy it to a new name in a different folder, for example a folder you create for the purpose. The file holds the logon name of the user who had the document open, so the copy keeps that record. Note the file's exact name and folder. Microsoft's page describes the name only as a tilde and a dollar sign followed by the remainder of the document file name, so pick the ~$ file that belongs to the locked document and no other.

Risk: the next step deletes the owner file from the folder. A user who really still has the document open can lose the lock that was protecting their changes.

Delete the owner file for the document from the folder that holds the document. Then start Word, answer No if it asks whether to load changes made to the Global or Normal template, and open the document.

To undo it, only while nobody has the document open: copy the saved owner file back into the document's folder under its original name. If anyone has started the document since, Word has already created a new owner file with that name, and copying the old one over it would restore the old lock.

Confirm the fix

  • The document opens for editing without the message.
  • While it is open, a new owner file exists in the folder again. That is expected, since Word creates it.
  • The message does not return when you close the document and open it again.

What to watch afterwards

  • The same document locked again soon after. Microsoft's page names someone checking the document out, an earlier version of Word and a crash while the document is open as causes, so look at who edits it and how.
  • Documents that are open over a network share. Microsoft's page names a network share as one cause.
  • Documents in SharePoint libraries that someone checked out and left. Microsoft's page names checking out, rather than just opening, as a cause.

Risks and limits

These steps have not been run or lab-tested.

Microsoft's pages cover Word. The owner-file page names the .doc owner file and its Task Manager steps carry the note ("Because there are several versions of Microsoft Windows, the following steps may be different on your computer"), so the buttons and tabs may differ on your system. That page gives no range of Word or Windows versions and shows no date. The SharePoint 2013 page is for Word 2016 only. None of Microsoft's three pages explain how to list who holds a file on a Windows file server. Do not delete an owner file while anyone may still have the document open.

Sources