"This file is locked for editing by 'another user'" or simply "File in Use" is one of Excel's most common and most confusing errors, because it frequently appears even when you're certain no one else has the file open. The good news is the underlying cause is usually simple: a leftover temporary file that didn't get cleaned up properly.

Ad placeholder — in-article responsive unit

Why this happens

Whenever you open an Excel file, Excel creates a small hidden temporary "lock" file in the same folder, named with a tilde and dollar sign prefix — for example, opening budget.xlsx creates a hidden file called ~$budget.xlsx. This temp file is what tells Excel (and other users, if the file is shared) that the file is currently in use. Normally, Excel deletes this temp file automatically the moment you close the workbook.

The problem comes when Excel doesn't close properly — a crash, a forced shutdown, a network interruption while the file was open on a shared drive, or even just closing your laptop lid without fully quitting Excel. In any of these cases, the temp lock file gets left behind, and Excel continues to think the file is in use by whoever had it open last, even if that person's Excel has long since closed.

Fix 1: Delete the leftover lock file (most common fix)

  1. Make sure Excel is fully closed on every device that might have had the file open.
  2. Open File Explorer and navigate to the folder containing the Excel file.
  3. You may need to enable hidden files first: in File Explorer, go to View → Show → Hidden items (or in older Windows versions, View tab → check "Hidden items").
  4. Look for a file named ~$ followed by your file's name — for example ~$budget.xlsx.
  5. Delete that hidden temp file.
  6. Reopen your original Excel file — it should now open normally without the lock error.

Note: deleting the temp lock file is safe — it's not your actual data, just a marker file Excel uses to track that the workbook is open. Your real file and its contents are untouched.

Fix 2: End any lingering Excel processes

Sometimes Excel appears closed but a process is still quietly running in the background, continuing to hold the lock:

  1. Open Task Manager (Ctrl+Shift+Esc)
  2. Look for any Excel or EXCEL.EXE entries, even if no Excel window is visibly open
  3. Select each one and click End Task
  4. Try opening the file again

If it's a genuinely shared file

If the file lives on a shared network drive or SharePoint/OneDrive and is actually open by someone else right now, the message is accurate rather than a glitch. Your options:

If the error persists with no one else using the file

If you've deleted the lock file, confirmed no Excel processes are running, and you're still getting the error every time you try to open any file (not just one specific file), the cause may be a corrupted Excel installation rather than a single file issue:

  1. Go to Settings → Apps → Installed apps
  2. Find Microsoft Office / Microsoft 365, click the three dots, and select Modify
  3. Choose Quick Repair first (faster, fixes most issues) — if that doesn't resolve it, run Online Repair instead (slower, more thorough)