‘report.xlsx’ is locked for editing by ‘another user’.

The message is precise and almost always wrong about who. Excel does not track users — it tracks a lock file sitting next to the workbook. If that file is stale, the lock outlives the person who created it.

The lock file

When you open report.xlsx, Excel creates a hidden file in the same folder:

~$report.xlsx

It contains the account name of whoever opened the workbook. Close the file properly and it disappears. Close it badly — crash, force quit, network drop, laptop lid — and the file stays behind, holding the lock indefinitely.

The name inside the lock file is why Excel says “by another user” even when the only other user was you, three days ago on a different machine.

The fix, in order

1. Show hidden files, then delete the lock file.

In File Explorer: View → Show → Hidden items. Delete ~$<filename>.xlsx. Reopen the workbook. This resolves the majority of cases.

2. Check it is really stale first.

If the file is on a network share or a synced folder, confirm nobody actually has it open. Deleting a lock file that belongs to an active session means two people editing the same workbook — the second save silently wins and the first is lost.

A quick check: open the lock file in Notepad. It lists the username. If that person is at their desk with the file open, wait.

3. Synced folders: pause the sync, then delete.

With OneDrive or Dropbox, a lock file can be re-created from the cloud the moment you delete it. Pause syncing, delete the lock, open the workbook, save it, then resume syncing.

4. Open it read-only, save as a new name.

If you need the data now and cannot clear the lock (a read-only network share, a folder you cannot write to), open the file read-only — Excel offers this in the same dialog — and immediately Save As to a local path. You get a working copy; the lock stays with the original.

5. Check for the read-only recommendation flag.

A workbook can be marked “Read-Only Recommended”, which produces a similar prompt even with no lock file. Clear it: File → Info → Protect Workbook → Always Open Read-Only (toggle off), or in Explorer: right-click → Properties → uncheck Read-only.

The OneDrive twist

On OneDrive and SharePoint, “locked by another user” often means something different: the file is checked out by a sync client that has not finished uploading, or an earlier conflict copy is holding the source. Two things to try before deleting anything:

  • Open the file in Excel for the web. Cloud editing uses a different locking mechanism; if it opens there, the lock is local to your device.
  • Look for conflict copies — report-DESKTOP-ABC123.xlsx next to the original. Excel treats these as separate files and sometimes reports the wrong one as locked.

When the workbook itself is the problem

If there is no ~$ file, no read-only flag, and no sync conflict, but Excel still will not open the workbook, the “locked” message is a red herring: the file is damaged and Excel is misreporting the failure. The giveaway is that the dialog appears instantly, before any read activity.

That is a corruption case, not a locking case — start with Open and Repair and, if the file is truncated, keep the original untouched.

FAQ

Is it safe to delete the ~$ file?

Only after you confirm nobody has the workbook open. The lock file holds the account name of the last person who opened it — read it in Notepad first. On a shared drive, deleting a live lock lets two people edit the same workbook, and the second save silently replaces the first.

Excel says I am the one who locked it.

That is the most common version of this, and it means the lock outlived your own session: a crash, a force quit, or a laptop that went to sleep with the file open. Delete the ~$ file and reopen — there is no risk here, since the session it refers to no longer exists.

Does this happen with Google Drive or Dropbox too?

Yes, with a twist: those clients generate conflict copies (report (DESKTOP-ABC's conflicted copy).xlsx) instead of respecting Office lock files, so you can end up with two files and a lock that points at neither. Pause the sync client before you clean up, otherwise it re-uploads the stale lock within seconds.

No lock file, still locked?

Then it is not a lock — it is a damaged workbook, and Excel is misreporting the failure. The giveaway is that the prompt appears instantly, before any disk read. The “will not open” walkthrough covers that case, and a structural repair clears it without touching your data.

No lock file, still locked? Email the workbook to help@easyofficefix.com and describe the prompt you see. Misreported errors usually mean structural damage that a repair can clear without touching your data.