Fix Cannot Delete File Because It Is Open in Another Location in Office
Question details
The user is unable to delete a file stored in OneDrive or SharePoint due to a system prompt stating the file is open in another location or program.

- Product
- OneDrive, SharePoint, Microsoft Office
- Device & OS
- not provided
- Scenario
- Attempting to delete a document from cloud storage or a local synced folder.
- Observed behavior
- The system prevents file deletion and displays an error warning that the document is locked, typically caused by multiple active browser tabs or background desktop applications.
Check your computer's taskbar and open browser windows to verify if the document is visibly open anywhere before attempting to force-close background processes.
Close All Active Instances of the Document
OneDrive and SharePoint treat files open in multiple tabs or apps as having multiple editors. Closing all instances removes the file lock.
This error most commonly occurs when a single document is simultaneously open in a web browser and a desktop application like Word or Excel.
Look through all your active browser windows and completely close any SharePoint or OneDrive tabs that are displaying the document.
Ensure the desktop versions of Word, Excel, or PowerPoint are completely closed. Look at your taskbar to verify no document windows remain open.
If the file is shared on SharePoint, verify that no other users are currently viewing or editing the document.
Return to your OneDrive or SharePoint folder, select the file, and press the Delete key.

Sign Out and Restart OneDrive
If closing the visual instances doesn't work, a background sync process might be holding the lock. Restarting OneDrive can clear this.
Avoid File Locking Issues with WPS Office
Microsoft Office and OneDrive can sometimes lock files in the background, causing frustrating deletion errors. Switch to WPS Office for a lightweight, fast, and free alternative that handles all your document needs without heavy, intrusive background processes.
- 1. Download the installer: Visit the official WPS Office website and click the 'Free Download' button.
- 2. Install the software: Run the downloaded executable file and follow the quick installation prompts on your screen.
- 3. Open existing files easily: Right-click any of your existing Microsoft Office files and choose 'Open with WPS Office' to edit seamlessly without lock issues.

Frequently Asked Questions
Does the File Explorer Preview Pane cause files to be locked?
Yes, having the Preview Pane enabled in Windows File Explorer can temporarily lock a document because the system reads it to generate the visual preview. Try disabling the Preview Pane under the View tab and deleting the file again.
Why does my file stay locked even after I close the browser?
Sometimes background processes take a few minutes to communicate with SharePoint or OneDrive servers to signal that the file is closed. Waiting 5 to 10 minutes often resolves the issue automatically.
Can I use Task Manager to force close the file?
Yes, if the file is locked by a frozen or hidden desktop application, you can press Ctrl + Shift + Esc to open Task Manager, locate the Word or Excel process in the list, and click 'End task' to forcefully release the file lock.
How do I know if someone else has the SharePoint file open?
In SharePoint or OneDrive online, you can check the 'Modified By' column, or open the document in your browser to see if there are other active users present (indicated by colored initials in the top-right corner of the document editor).




