Excel File Locked by Another User? Fix It
In this article
If you see “File in use” or “locked by another user” when opening an Excel file, it usually means someone else has the file open, or Excel thinks they do. Here’s how to fix it quickly and prevent it from happening again.
Why Excel Locks Files
Excel locks a file to prevent two people from editing the same copy at the same time, which would cause lost changes or corrupted data. When you open a workbook, Excel creates a temporary lock file (with a name like ~$filename.xlsx) in the same folder. This lock file tells other users that the file is in use. The lock is normally removed when you close the workbook, but sometimes it stays behind—especially after a crash, a power outage, or a forced shutdown.
The lock appears in two common forms:
- “File in use”
- “Read-Only” message: “Open a copy” or “Open read-only” options are shown.
Both mean the same thing: Excel believes someone is editing the file. The lock is tied to the file’s location, not to the file itself. So if the file is on a network drive, a shared folder, or cloud sync folder, the lock can be seen by other users.
How to Check Who Has the File Open
If you’re on a network or shared drive, you can often see who has the file open before you try to break the lock.
- Open the folder that contains the Excel file.
- Look for a file that starts with
~$followed by the workbook name (e.g.,~$Report.xlsx). - Right-click that lock file and select Properties. The Details tab may show the user name of the person who created it.
If you have access to the server or shared drive, you can also check the “Open Files” section in the server’s management console. On Windows, you can use Computer Management → System Tools → Shared Folders → Open Files to see who has the file open. This is the safest way to confirm whether someone is actually using the file.
How to Unlock an Excel File
Before you delete any lock file, make absolutely sure no one is really editing the workbook. If you delete a lock file while someone has the document open, they might lose their unsaved changes or encounter errors when saving.
Here are the steps to unlock a file that you believe is locked unnecessarily:
- Ask the person who opened the file to close it. If they’re on a different computer, call them or send a message.
- If they can’t close it (e.g., their computer crashed), wait a few minutes—Excel may release the lock automatically after a timeout.
- If the lock persists, go to the folder and delete the
~$lock file. You can only do this if you have permission to modify the folder. - If you can’t delete the lock file, close all Excel instances on your machine, then reopen the file. Sometimes your own Excel session still holds a lock from a previous crash.
- If the file is stored on OneDrive or SharePoint, close the file in the browser and on all devices. Cloud services may keep a lock for a short time after the last edit.
After deleting the lock file, open the workbook normally. If it opens without the “locked” message, the issue is resolved.
Why the Lock Sometimes Won’t Go Away
There are a few reasons why a lock file might remain even after everyone has closed the workbook:
- Excel crashed and didn’t remove the lock file.
- Another process (like a backup tool or antivirus) is holding the file.
- Network issues prevented the lock file from being deleted.
- You’re opening the file from a synced folder (OneDrive, Dropbox) and the sync client is still uploading/downloading.
- You have the file open in another program (e.g., a preview pane, a PDF converter, or a data analysis tool).
If you’ve deleted the lock file and the problem persists, try restarting your computer. That clears any hidden handles that Windows may still have on the file.
How to Prevent Locked File Errors
You can’t always prevent other users from opening a file, but you can reduce the chance of getting stuck with a stale lock.
- Always close Excel properly—don’t just shut down your computer.
- If you’re sharing a file, consider using co-authoring in OneDrive or SharePoint. Multiple people can edit at the same time without locking each other out.
- If you’re on a network drive, avoid leaving the file open when you step away. Close it or save and close.
- If you frequently crash, enable AutoRecover so you don’t lose work, and the lock file will be cleaned up more reliably.
- For sensitive files, you can set a password to prevent others from opening the file, but that doesn’t stop the lock message.
What to Do If You See “Open Read-Only”
Sometimes Excel offers to open the file as read-only. This is a safe option if you just need to view the data. However, if you need to edit, you have a few choices:
- Click “Open Read-Only” to view the file, then save a copy under a different name if you need to edit.
- Click “Open a Copy” to create a new file that you can edit freely.
- If you believe the lock is stale, click “Notify” and wait for the user to close the file. Excel will let you know when it’s available.
Opening a copy is often the fastest solution if you need to make changes right away. Just remember to merge your changes back into the original later, if necessary.
Frequently Asked Questions
What does “locked by another user” mean in Excel?
It means that Excel has created a temporary lock file for the workbook, and that lock file is still present. Usually it’s because another person has the file open, or because Excel crashed and didn’t remove the lock.
Can I force Excel to unlock a file?
Yes, but only if you’re certain no one is actively editing. You can delete the ~$ lock file in the same folder. If you can’t delete it, you may need to ask the file owner or an administrator to remove it.
Why does Excel say the file is locked when no one is using it?
This usually happens after a crash or a network glitch. The lock file wasn’t deleted. Restarting Excel or your computer often clears it. If not, delete the lock file manually.
How do I see who has an Excel file locked?
On a network drive, check the ~$ lock file’s properties for the user name. On Windows Server, use Computer Management → Shared Folders → Open Files. On OneDrive or SharePoint, you can see who’s viewing the file in the browser.
Is it safe to delete the ~$ file?
Only if you are 100% sure no one is editing the workbook. Deleting a lock file while someone is working can cause them to lose changes or see errors. When in doubt, ask the other user to close the file first.
How do I stop Excel from locking files?
You can’t completely disable locking—it’s a safety feature. But you can use co-authoring in OneDrive/SharePoint, which allows multiple users to edit simultaneously without locking. For local files, make sure everyone closes Excel properly.