SharePoint File Locked for Editing
Resolution Checklist
- 1 Understand the root causes of SharePoint file lock errors
- 2 Force release locked sessions via the SharePoint Web Interface
- 3 Terminate zombie Office processes on Windows
- 4 Release locked Excel/Word file descriptors on macOS
- 5 Configure library check-in and checkout options correctly
SharePoint File Locked for Editing
Encountering a “File is locked for editing”, “File in Use”, or “Locked by another user” error in SharePoint Online or Microsoft Teams blocks you from saving modifications. This happens because the cloud server assigns a temporary edit lease to a user session. If that session terminates abruptly (due to a crash, network disconnect, or sync failure), the cloud lease remains active, preventing others from modifying the file.
This guide outlines how to force release file locks administratively in the web UI, kill hung Office processes locally, and manage library checkouts.
1. What Causes SharePoint File Locks?
File locks are managed by SharePoint’s co-authoring server and local client applications:
- Orphaned Server Leases: When a user closes a document while offline or their internet drops, the server-side edit lease (which usually lasts 10 to 60 minutes) remains active.
- Mandatory Checkout Enforced: The document library configuration requires users to explicitly “Check Out” files before editing. If a user leaves the file checked out, it is locked for everyone else.
- Zombie Local App Processes: Microsoft Excel (
EXCEL.EXE) or Word (WINWORD.EXE) remains running in the background of a client machine, keeping a lock file active in the local cache.
2. Force Release Locks via SharePoint Web Portal
If a user is listed as locking a file but they have closed it, you can override the lock through the web interface.
A. Override Mandatory Checkouts (For Administrators/Owners)
If the library uses checkout settings:
- Open the SharePoint document library in your web browser.
- Locate the locked file, click the vertical ellipsis (…) next to it, and select More → Check in.
- Alternatively, if the changes made by the locking user are not needed, select Discard check-out to revert to the last saved version.
B. Force Close Co-authoring Session
If co-authoring is stuck:
- Open the file in Office Online (e.g. Word or Excel for Web) rather than the desktop app.
- Look at the top right corner to see who is currently active in the document.
- If an inactive session is shown, the owner of the document can save a copy or wait for the auto-timeout (usually 10-15 minutes of inactivity).
3. Clear Local Process Locks on Windows
If the lock is originating from your own machine and you cannot edit the file:
A. Terminate Background Microsoft Office Tasks
A background Excel or Word thread may be holding the file handle open:
- Press
Ctrl + Shift + Escapeto launch Task Manager. - Click on the Details tab.
- Search the list for
EXCEL.EXE,WINWORD.EXE, orPOWERPNT.EXE. - Select the process and click End Task.
- Alternatively, execute this in Command Prompt:
taskkill /f /im EXCEL.EXE /im WINWORD.EXE /im POWERPNT.EXE
B. Delete Hidden Temporary Owner Files
Office apps create hidden temporary files (starting with ~$) in the sync directory:
- Open File Explorer and navigate to your synced SharePoint folder.
- Click on View (top menu) → Show → check Hidden items.
- Look for files in the format
~$filename.docxor~$filename.xlsxin the same directory as your locked document. - Delete these temporary lock files.
4. Clear Local Process Locks on macOS
On macOS, native app sandboxing can cause the Office app to lock local file descriptors inside container directories.
A. Force Kill Hung Office Services
- Open Terminal (via Spotlight search).
- Run the command to kill any running Office app processes holding files:
killall -9 "Microsoft Excel" "Microsoft Word" "Microsoft PowerPoint"
B. Check for System Locks (lsof)
To identify which local process is locking the file:
- Open Terminal.
- Type
lsoffollowed by a space, then drag-and-drop the locked file from Finder into the Terminal window (which outputs its path), then press Enter:lsof "/Users/username/Library/CloudStorage/OneDrive-SharePoint/Documents/LockedFile.xlsx" - Look at the PID column of the output. Run
kill -9 <PID>using the target PID to free the file handle.
5. Summary Lock Management Reference
- Check In / Discard Checkout: Right-click the file in the SharePoint web browser interface under More to release administrative locks.
- Taskkill Office Apps: Terminate orphaned process handles on Windows using
taskkill /f /im EXCEL.EXE. - Purge Hidden Temporary Files: Delete the
~$[filename]hidden files from the local synced folder. - Lsof Handle Scans: Use
lsof [filepath]in macOS Terminal to detect which local daemon has locked the file.