"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.
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)
- Make sure Excel is fully closed on every device that might have had the file open.
- Open File Explorer and navigate to the folder containing the Excel file.
- 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").
- Look for a file named
~$followed by your file's name — for example~$budget.xlsx. - Delete that hidden temp file.
- 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:
- Open Task Manager (Ctrl+Shift+Esc)
- Look for any Excel or EXCEL.EXE entries, even if no Excel window is visibly open
- Select each one and click End Task
- 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:
- Ask the person directly — the dialog usually shows their username; reach out and ask them to close it.
- Use co-authoring instead — if the file is stored on OneDrive or SharePoint (not a traditional network drive), modern Excel supports real-time co-authoring, where multiple people can edit simultaneously without locking. If you're hitting this error on a SharePoint file, check whether co-authoring is actually enabled, since older "Shared Workbook" legacy settings can sometimes force exclusive locking instead.
- Open as read-only and save a copy — if you just need to view or extract data without waiting, open in read-only mode and save your own copy under a different name.
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:
- Go to Settings → Apps → Installed apps
- Find Microsoft Office / Microsoft 365, click the three dots, and select Modify
- Choose Quick Repair first (faster, fixes most issues) — if that doesn't resolve it, run Online Repair instead (slower, more thorough)