You try to open, edit, or sync a file in OneDrive and see a message that the file is already in use. This error stops you from making changes or uploading the latest version. The cause is usually a lock held by another application, a background process, or a sync conflict. This article explains why the lock happens and gives you step-by-step methods to release the file and resume normal work.
Key Takeaways: How to Unlock a File Stuck in OneDrive
- Close the file in all Office apps: Saving and closing the document in Word, Excel, or PowerPoint releases the lock.
- Restart OneDrive: Right-click the OneDrive cloud icon in the notification area and select Pause syncing then Resume syncing to clear temporary locks.
- Use Handle or Process Explorer: Run the command
handle -a -u <filepath>in an admin Command Prompt to find and close the locking process.
Why OneDrive Displays the File Already in Use Error
OneDrive relies on file locks to prevent data corruption when multiple users or processes try to change the same file at the same time. When an application opens a file, Windows applies a read-only or exclusive write lock. OneDrive cannot sync the file until the lock is removed. Common causes include an Office document left open in a background process, a third-party backup tool scanning the file, or a Windows Search indexer holding the file open. The error can also appear when the file is open on another device that syncs the same OneDrive account. In that case, the remote lock prevents your local copy from syncing until the other device closes the file.
Steps to Release the Lock and Fix the Error
Follow these steps in order. Stop after each step and check if the error clears.
- Close the file in all Office applications
Open Task Manager by pressing Ctrl+Shift+Escape. Look under the Processes tab for Word, Excel, PowerPoint, or any other Office app that might have the file open. Select the process and click End task. Then try syncing the file again. - Restart OneDrive sync
Right-click the OneDrive cloud icon in the taskbar notification area. Select Pause syncing and choose 2 hours. Wait 10 seconds, then right-click the icon again and select Resume syncing. This clears temporary locks held by OneDrive itself. - Check for file open on another device
Sign in to the OneDrive website at onedrive.live.com. Navigate to the file and look for a user icon or a lock symbol next to the file name. If another user or device has the file open, ask them to close it. Wait up to 5 minutes for the lock to expire. - Run the Handle utility from Sysinternals
Download Handle from the Microsoft Sysinternals website. Open Command Prompt as administrator. Run the commandhandle -a -u "C:\Users\YourName\OneDrive\Path\To\File.docx". The output shows the process ID and executable name that holds the lock. Note the process ID. Runtaskkill /PID <processID> /Fto force close that process. - Use Process Explorer to close the handle
Download Process Explorer from Microsoft Sysinternals. Run it as administrator. Press Ctrl+F and type the file name. Process Explorer lists all open handles on that file. Right-click each handle and select Close Handle. Confirm the action. This releases the lock immediately. - Rename the file to break the lock
If the lock persists, close all Office apps. Open File Explorer and navigate to the file. Press F2 to rename the file, for example add "_old" to the end. Press Enter. OneDrive detects the change and attempts to sync the renamed file. Rename the file back to its original name. This often clears stale locks. - Reset OneDrive
Press Windows+R, typeonedrive.exe /reset, and press Enter. Wait 2 minutes. OneDrive restarts automatically. If it does not, press Windows+R again and type%localappdata%\Microsoft\OneDrive\onedrive.exe. This resets the sync engine and clears all file locks held by OneDrive.
If OneDrive Still Shows the File Already in Use Error
File is open in a hidden Office background process
Office apps sometimes keep files open in the background even after you close the window. Open Task Manager and look for any Office processes running under Background processes. End each one. Then open the Office app, close the file again, and exit the app completely.
Third-party antivirus or backup software locks the file
Some security programs scan files and hold a temporary read lock. Temporarily disable the software and check if the error clears. If it does, add the OneDrive folder to the exclusion list in the antivirus settings. For backup tools, pause the backup job while you edit files in OneDrive.
Windows Search Indexer holds the file open
The Windows Search Indexer may lock a file while indexing content. Open Services.msc, locate Windows Search, and select Stop. Try syncing the file. If the error goes away, rebuild the search index by going to Control Panel > Indexing Options > Advanced > Rebuild.
Network file lock from a file server or NAS
If the file is stored on a network drive that syncs to OneDrive, another user on the network may have it open. Check with your network administrator or look at the file server’s open file list. Ask the user to close the file. For local files, avoid storing OneDrive files on network mapped drives.
File Lock Methods: Local vs Remote vs Sync Lock
| Item | Local Lock | Remote Lock | Sync Lock |
|---|---|---|---|
| Description | An application on your PC holds the file open | Another user or device holds the file open via OneDrive | OneDrive itself holds the file during upload or download |
| How to detect | Use Handle or Process Explorer to find the process | Check the OneDrive website for a lock icon | Look for a blue sync icon or a "syncing" status in OneDrive |
| How to fix | Close the app or end the process in Task Manager | Ask the remote user to close the file or wait for the lock to expire | Wait up to 5 minutes or restart OneDrive |
| Prevention | Save and close files before leaving your desk | Use co-authoring in Office apps instead of exclusive locks | Pause syncing during large file operations |
You can now identify which type of lock is blocking your file and apply the correct fix. Next time you see the error, start with the simplest step: close the file in all Office apps. For persistent locks, use the Handle utility or Process Explorer to force-close the locking process. To prevent future conflicts, enable co-authoring in Office documents so multiple users can edit the same file without exclusive locks.