MS Office file "is locked for editing" by me

  • 7015811
  • 21-Oct-2014
  • 14-Aug-2019

Environment

Client for OES 2 SP3 for Windows
Microsoft Office 2013
Microsoft Excel
Microsoft Word

Situation

When attempting to edit a document or spreadsheet, the user gets a message:

File in Use
<filename> is locked for editing
by 'username'.
Open 'Read-Only' or click 'Notify' to open read-only and receive notification when the document is no longer in use.

Where the name of the user identified is the user who is attempting to open the file. The user is certain that they do not have the file open when the message appears.

Resolution

NOTE: Microsoft Office users can encounter this problem whether or not Client for Open Enterprise Server is in use. It is not a problem with Client for OES itself.

In certain cases, the following solution resolves the problem. However, it may not resolve the problem, as there may be other causes which may be resolved by other solutions not documented here.

MS Office creates a temporary file (in the same location as the file being edited) containing the name of the user who has opened the document or spreadsheet file for editing. When another user attempts to open the file, Office checks for the presence of the temporary file. If it exists, it reads the name of the user who has the file open and inserts that name into the error message displayed.

Normally, the temporary file is removed when the file is closed/saved, but if the file is mistakenly left on the drive due to an application crash or other unusual event, this problem can occur.

If you are seeing this particular behavior:

Using Windows Explorer (or any other tool that allows you to manage the file system), navigate to the location of the file you are editing, and delete the temporary file in the form of ~$<filename> which corresponds to the file you are editing. Then, re-open the file you are editing.

If you are not seeing this particular behavior:

Contact Microsoft for other solutions.

Additional Information

For more information, see this thread on the answers.microsoft.com website.