When Excel tells you a file is “locked for editing” by another user, or even by your own username, it means a file-lock flag is active in that directory. Under normal circumstances, Excel creates a hidden temporary file called an owner file whenever a workbook opens. If Excel crashes, loses its network connection, or closes improperly, this owner file stays behind on the drive. Excel reads this leftover “ghost” file as an active session, locking everyone else out.
Quick Answer
Close Excel completely on all computers. Open Windows File Explorer, go to the View tab, and check Hidden items. Navigate to the folder containing the locked workbook. Look for a faded file starting with
~$that matches your workbook’s name (for example,~$Budget.xlsx), select it, and press Delete.
Understanding the “Ghost” Owner File
Whenever you open Financials.xlsx, Excel immediately generates a small, hidden lock file in the exact same directory named ~$Financials.xlsx.
This file is roughly 165 bytes in size. Its sole job is to store the logon name of the person who opened the workbook. When a second user attempts to open Financials.xlsx, Excel scans the directory, detects ~$Financials.xlsx, reads the username inside it, and displays the familiar warning:
“Financials.xlsx is locked for editing by ‘User’. Open ‘Read-Only’ or click ‘Notify’…”
When you exit Excel normally, the program deletes this temporary file automatically. However, if Excel terminates unexpectedly—due to a Windows crash, power cut, forced task termination, or dropped Wi-Fi connection to a server—the file remains on disk. Excel cannot distinguish between an active user and an abandoned lock file.
Step-by-Step: Removing the Ghost File
Before attempting manual deletion, ensure the file is not legitimately in use. If a co-worker actually has the workbook open, forcing a lock removal can cause conflicting copies or lost work.
1. Enable Hidden Items in Windows Explorer
Because owner files have both “Hidden” and “System” attributes, Windows hides them by default:
- Open File Explorer (
Windows Key + E). - Click the View tab at the top.
- In the Show/hide section, check the box for Hidden items.
- (Optional for stubborn files): Click Options > Change folder and search options > View tab. Uncheck Hide protected operating system files (Recommended) and click Apply.
2. Locate and Delete the Owner File
- Browse to the directory containing your locked workbook.
- Look for a file whose name begins with a tilde and dollar sign (
~$). If your workbook is namedInventory_2026.xlsx, the ghost file is~$Inventory_2026.xlsx. - Select the
~$file and press Shift + Delete to permanently remove it. - Double-click the primary workbook. It should now open with full read-write permissions.
What If Windows Refuses to Delete the Ghost File?
If you try to delete the ~$ file and receive an error stating “The action can’t be completed because the file is open in Microsoft Excel”, an orphaned background process is holding the handle open.
Clear Orphaned Excel Processes
Even if Excel is not visible on your screen, a background instance (EXCEL.EXE) may still be running in a frozen state.
- Press Ctrl + Shift + Esc to open Task Manager.
- Go to the Processes tab (or Details in Windows 11).
- Scroll through the list and look for Microsoft Excel.
- Right-click any running Excel process and select End task.
- Once all instances are terminated, return to File Explorer and delete the
~$file.
Deleting Ghost Locks on Network Shares and File Servers
When workbooks are stored on a local network server (SMB share) or NAS, an ungraceful disconnect leaves the file lock active on the server operating system itself. Deleting the ~$ file locally may fail with a permission error.
If you have administrative access to the Windows File Server hosting the share:
- Connect to the server or open Computer Management (
compmgmt.msc). - Expand System Tools > Shared Folders > Open Files.
- Scan the list for the workbook name or its corresponding
~$temporary file. - Right-click the locked resource and select Close Open File.
This immediately terminates the network lock handle and clears the ghost state without requiring a server reboot. If you share workbooks using legacy shared modes rather than modern co-authoring, persistent locks are common; see Handling “Someone else has this file open” when using Legacy Shared Workbooks.
When the Ghost File Keeps Returning
If ghost files fail to delete upon closing workbooks consistently, your environment has a configuration conflict:
- Antivirus Locking: Real-time endpoint security suites frequently scan new or altered files. If your antivirus locks
~$filenameduring Excel’s exit routine, Excel cannot delete the file before closing. Add an exclusion for standard temporary Office file patterns (~$*.xlsx,~$*.xlsm) in your local antivirus client. - Preview Pane Locks: If you have the File Explorer Preview Pane active (
Alt + P), selecting an Excel file in Explorer launches an invisible preview handler. This handler acts like an open session and can spawn or lock~$files. Turn off the Preview Pane to test. - Cloud Sync Collisions: If your folder syncs through OneDrive, Google Drive, or Dropbox, the sync engine may upload the
~$file before Excel can delete it, locking it in the cloud. If you frequently encounter file sharing clashes on local disks, review “Sharing Violation”: Why Excel won’t let you save over an existing file.