Corporate work environments frequently deploy shared network drives (such as Windows Server SMB shares, NAS appliances, or mapped drives) to facilitate team spreadsheet workflows. However, opening a shared workbook only to encounter an alert dialogue reading ‘File in Use – [filename] is locked for editing by another user’ – particularly when the named colleague is away or not working in the file – blocks critical updates.
This phantom locking condition commonly arises from orphaned temporary owner lock files (such as hidden ~$filename.xlsx structures), Windows File Explorer Preview Pane handles retaining exclusive read locks, or stalled SMB server connection handles. Follow these proven methods to release the lock cleanly.
Identify and Remove Orphaned Temporary Lock Files
Whenever an Excel document is opened, Microsoft Office automatically generates an invisible owner file in the identical directory. This file begins with a tilde and dollar sign (e.g., ~$FinancialReport.xlsx) and registers the active username. If Excel terminates unexpectedly due to a crash or network disconnect, this lock file remains stranded on disk.
- Open File Explorer and navigate to the network folder housing the locked workbook.
- Click View in the top menu bar, select Show, and ensure Hidden items is checked.
- Look for a faint, semi-transparent file matching your workbook name prefixed with
~$. - Ensure all other users have closed the document, then select the orphaned
~$file and press Delete. - Re-open the primary workbook; it should now open in full read-write edit mode.
Disable File Explorer Preview and Details Panes
A widespread cause of mysterious Excel file locks is the built-in Windows File Explorer Preview Pane. When active, File Explorer launches an internal instance of the Excel preview handler that creates a persistent read handle on the file, preventing the main application from obtaining write permissions.
- Inside File Explorer, look at the top command toolbar.
- Click the View menu.
- Under the Show sub-menu, ensure that both Preview pane and Details pane are unticked (or press Alt + P to toggle the Preview pane off).
- Close all open File Explorer windows, wait ten seconds, and relaunch Excel.
Terminate Stalled SMB File Handles on the File Server
If your organisation hosts files on a central Windows Server, an abrupt workstation disconnect or sleep cycle can leave an open SMB session registered on the server operating system.
- On the file server hosting the network share, press Windows Key + R, type
compmgmt.msc, and press Enter to launch Computer Management. - Navigate to System Tools > Shared Folders > Open Files.
- Sort the listed entries by file name and find the locked spreadsheet.
- Right-click the open file handle and choose Close Open File.
- Alternatively, from an administrator PowerShell console on the server, view and terminate the handle by executing:
Get-SmbOpenFile | Where-Object Path -like "*SpreadsheetName*" | Close-SmbOpenFile -Force
Clear Excel Office Document Cache
When working with network locations connected via SharePoint or OneDrive synchronisation clients, corrupted local upload cache queues can trick Excel into believing a file conflict exists.
- Open Excel and click File > Options.
- Select the Save tab from the sidebar.
- Scroll down to the Cache Settings section.
- Click Delete cached files and confirm the deletion.
- Check the box marked Delete files from the Office Document Cache when they are closed to prevent future stale state retention.