
The File in Use message, “name.xlsx is locked for editing by” someone, means Excel believes another session already has the workbook open for editing, so it won’t let you save changes to it. Sometimes that’s true. Often the “other user” is you, on another device or in a copy of Excel that never closed properly.
The fix depends on where the file is saved, so check the path in Excel’s title bar or in File Explorer first. A workbook on a shared network drive can only have one editor at a time; the lock is usually an open session on the server, and a small hidden owner file supplies the name Excel shows. A workbook in OneDrive, SharePoint or Teams is meant to be co-authored by several people at once, so a lock there means something is blocking co-authoring.
While you investigate, Read Only and Notify are always safe.
Try these first
- Ask the person named in the message to close the workbook, or choose Notify to be told when it is free.
- If the name is yours, close the file on every device, including other PCs and your phone, then wait a few minutes.
- Save any other open workbooks, then open Task Manager (Ctrl + Shift + Esc), end any leftover Excel tasks and reopen the file.
- Network drive: once everyone has closed it, look for a hidden ~$ file beside the workbook.
- OneDrive, SharePoint or Teams: try the file in Excel for the web. If it edits there, your desktop Excel or its sign-in is the problem; if not, check that it’s .xlsx, .xlsm or .xlsb.
- SharePoint library: check whether the file is checked out to someone.
Which kind of lock do you have?
Where the workbook lives decides what the lock is and who can release it.
| Where the file is | What the lock usually is | What to do |
|---|---|---|
A shared network drive or NAS (a \\server\share path or a mapped drive letter) | A colleague has it open, or a crash left an owner file or server session behind | See the network drive section |
| OneDrive, SharePoint Online or a Teams channel’s Shared tab (formerly Files) | Someone opened it in a version or format that can’t co-author, or a feature in the file blocks co-authoring | See the OneDrive, SharePoint and Teams section |
| A SharePoint library that requires check-out | The file is checked out to one person | Check it in, or have a site owner do it |
| Your own PC, a USB drive, Dropbox or Google Drive (or Box, unless its admin has turned on Box for Microsoft Office Co-Authoring) | These locations don’t support co-authoring, so another copy of Excel or another app holds it | See the locked-by-yourself section |
| Any location, and the message shows your own name | Another of your devices, a hidden Excel process, or a sync that hasn’t finished | See the locked-by-yourself section |
| No File in Use message, but a yellow Protected View or Marked as Final bar, or Viewing mode | Not a lock: the file came from email or the internet, was marked final, or you only have permission to view it | Select Enable Editing or Edit Anyway if you trust the file; in OneDrive or SharePoint, select Viewing > Request more access |
If Excel isn’t showing a lock but freezes, crashes or won’t open, that’s a different problem; see Excel not responding.
Locked by yourself
Microsoft’s first step for a lock in your own name is to close the file on all your devices and wait a few minutes for the server to release it. If it’s still locked, check these:
- A hidden copy of Excel. After a crash, a background Excel process can keep the file open; end every Excel entry in Task Manager, including any under Background processes, and reopen the file.
- Another session that’s still you. A laptop left open at home, Excel on your phone, or a Remote Desktop session you disconnected from instead of signing out, which keeps Excel running with the file open.
- Another program reading the file. Backup tools, scripts and add-ins can hold a workbook open. Microsoft’s Excel support team also found File Explorer’s Preview and Details panes holding files on older Windows; if nothing else explains it, turn them off under View > Show and test again.
- OneDrive still uploading your last save. For a workbook in a synced folder, let the OneDrive icon finish syncing. Make sure the sync app is current and not paused; if it shows errors, see OneDrive not syncing.
Files on a shared network drive
Server paths don’t support co-authoring, so only one person can edit a workbook on a network share at a time. Before clearing any lock, make sure nobody is still working in the file.
Check the name against the owner file
The name in the message comes from a small hidden owner file that Office creates in the same folder when someone opens the workbook. Its name starts with ~$ followed by the workbook’s name, sometimes shortened. Excel normally deletes it on close. Microsoft’s Excel support team describes how anything that breaks Excel’s connection to the file while it’s open, such as the server restarting, can leave it behind, so later users see a stale or wrong name.
Ask the person named to check first. If they don’t have it open, or they’ve left the company:
- Open the folder in File Explorer and show hidden files: View > Show > Hidden items in Windows 11, or tick Hidden items on the View tab in Windows 10.
- Find the
~$file beside the workbook and delete that small file only, never the workbook itself. If Windows says it’s in use, someone still has the workbook open; stop and use the server step below. - Open the workbook again. If it’s still locked, often now naming “another user” or no one, something still has the workbook itself open, such as a session on the server or a backup tool; use the server step below.
Close the open file on the server
On the server or PC that shares the folder, an administrator can see who holds the file. Open Computer Management and go to System Tools > Shared Folders > Open Files; the Accessed By column shows the user, and Sessions shows which computer they’re on. Right-click the workbook and choose Close Open File. On a Windows file server, Get-SmbOpenFile in PowerShell run as administrator lists open files with each client’s computer and user name, and Close-SmbOpenFile -FileId followed by the file’s ID closes one after asking you to confirm.
Microsoft warns that forcibly closing a file can lose any changes the user hasn’t written back to the server yet. Warn the person first and, if they can still reach the file, have them save a copy under a new name.
On a NAS, look for an open-files or active-connections page in its admin panel; the name and location vary by brand. If the drive itself keeps dropping, which can leave orphaned locks behind, see our guide to a mapped network drive that keeps disconnecting.
Files in OneDrive, SharePoint or Teams
Workbooks stored in OneDrive, SharePoint Online or a Teams channel’s Shared tab, which is a SharePoint library underneath, are built for co-authoring: several people edit at once and see each other’s changes within seconds. When someone gets a lock instead, one of Microsoft’s conditions isn’t met.
| Requirement | What breaks it | Fix |
|---|---|---|
| Everyone uses a version of Excel that co-authors | One person opens it in an Excel that can’t co-author: Microsoft names Excel 2016, Excel 2019 and Excel LTSC 2021, the volume-licensed edition (retail Excel 2021 does co-author). That one person causes the lock for everyone else | They close it and use Excel for the web or Microsoft 365 Excel, signed in with their work account; File > Account shows which Excel a PC has |
| A supported file format | The file is .xls, .csv or Strict Open XML; Microsoft lists only .xlsx, .xlsm and .xlsb for co-authoring | Use File > Save As or Save a Copy (whichever your File menu shows), choose Excel Workbook (*.xlsx) as the type, check the new file, and share it |
| AutoSave available in desktop Excel | AutoSave is greyed out, usually because the file is an older .xls, its OneDrive sync is paused, or it uses a feature listed below. AutoSave that’s simply switched off doesn’t cause a lock | If you can’t turn on AutoSave at the top left, check the format and the features below |
| Nothing in the file that blocks co-authoring | The legacy Shared Workbook feature, a password to open, restricted access, an add-in, or tables set to refresh on open | Remove them as described below |
| Everyone opens the cloud file itself | Someone opened a SharePoint snapshot, an emailed attachment or a downloaded copy | Open the workbook from the library, Teams or the OneDrive folder |
Remove features that block co-authoring
Ask whoever has the file open to work through Microsoft’s list in this order:
- Turn off the legacy Shared Workbook feature, which co-authoring replaced. Current Excel hides its button: add Share Workbook (Legacy) under File > Options > Quick Access Toolbar (All Commands). First make sure everyone else has finished and, as Microsoft advises, copy the change history if you need it. Then open the button, check you’re the only person listed on the Editing tab, clear Allow changes by more than one user and select Yes when warned about other users.
- Remove a password to open or restricted access under File > Info > Protect Workbook only if your policy allows it. Without them, anyone who can open the library or folder can read the workbook, so check who has access first. Microsoft suggests a sensitivity label instead, but a label that encrypts only allows co-authoring in desktop Excel once your admin turns on co-authoring for labeled files in Microsoft Purview.
- For each table or PivotTable connected to outside data, open its Connection Properties and untick Refresh data when opening the file.
- Disable a suspect add-in under File > Options > Add-ins > Excel Add-ins > Go.
On a Mac, use Review > Protect Workbook, File > Restrict Permissions > No Restrictions, the Table tab > Refresh > Connection Properties, and Tools > Excel Add-ins.
If someone’s work was overwritten while co-authoring, version history in Microsoft 365 can bring back the earlier copy; Microsoft advises waiting until nobody is co-authoring before restoring.
Rather have a technician sort it out?
If a workbook stays locked after everyone has closed it, a technician can connect remotely with your permission, look for the session or leftover file holding the lock and help clear it once you’ve confirmed nobody still has unsaved work in it. A GoProIT technician can connect remotely, with your permission, and fix it while you watch. $59 per fix, Mon–Fri 8am–8pm ET.
SharePoint files that are checked out
Some SharePoint libraries require check-out before editing. A checked-out file is reserved for one person until they check it in or discard the check-out, and co-authoring doesn’t apply.
- See who has it. Checked-out files show a small icon beside the name in the library; point at the file name to see who has it.
- Check it in. The person who has it selects the file, opens the … menu and chooses Check in, or uses File > Info > Check in in desktop Excel. Choosing Discard check out instead throws away the changes made since checking it out.
- They’re away or have left. Someone with enough permission, usually a site owner, can check the file in for them. SharePoint warns that it’s checked out to another person, and selecting OK overrides it. Edits they made in a downloaded copy and never uploaded don’t come with it.
Microsoft advises teams that co-author not to check files out, so ask the site owner whether that library needs to require check-out; turning that library setting off avoids this lock for everyone.
Stop it happening again
- Move shared workbooks to SharePoint or Teams. Files that several people edit belong in a library that supports co-authoring, not on a file server. Check each one after the move, especially workbooks with links to other files.
- Put everyone on an Excel that co-authors. One PC with Excel 2019 or earlier, or Excel LTSC 2021, is enough to lock shared files for the whole team. In the Microsoft 365 admin center, Users > Active users shows each person’s licenses; Business Basic includes only the web and mobile apps, while Business Standard and Business Premium include the desktop apps. Check the PCs too; an old copy of Excel may still be installed.
- Convert old working files. Save shared .xls workbooks as .xlsx, and keep CSV exports as import files, not shared working files.
- Sign out of remote sessions. Closing the Remote Desktop window disconnects without signing out, which leaves Excel and its files open on the server.
Planning that move, with sensible library, permission and sharing settings, is what our cloud file sharing and access setup covers.
When to stop and get help
- The same workbook locks every day on the network share without any crashes. That points at the server, the NAS firmware or security software scanning the share.
- The lock names someone who left months ago and you can’t delete the owner file. You likely lack permission on that folder, and whoever administers the server needs to clear it.
- A SharePoint or OneDrive file stays locked for hours with nobody in it and nothing checked out. Your Microsoft 365 admin may need to raise it with Microsoft support.
- Someone lost edits after a forced close or a conflict. Stop editing that workbook and restore from version history or your backup before more changes pile on top.
If you’d rather not untangle it yourself, a stuck lock on one file is a typical $59 remote fix: a technician connects through our remote computer help only after you approve it, looks for what’s holding the file while you watch, and you can end the session at any time.
Common questions
Is it safe to delete the ~$ file next to an Excel workbook?
Yes, once you’re sure nobody has the workbook open. It’s a small hidden marker Office uses to record who opened the file, and deleting it doesn’t touch the workbook or its data. If Windows refuses because the file is in use, someone still has the workbook open, so leave it alone. Never delete it while a colleague is working in the file.
Can two people edit the same Excel file at the same time?
Yes, if the workbook is stored in OneDrive or SharePoint Online in .xlsx, .xlsm or .xlsb format and everyone uses a version that co-authors, such as Microsoft 365 Excel, Excel for the web or the mobile apps. On a network share, a local folder, Dropbox, Google Drive or an on-premises SharePoint Server library, only one person can edit at a time. Box co-authors only when its admin has turned on Box for Microsoft Office Co-Authoring. The old Shared Workbook feature has been replaced by co-authoring.
What does the Notify button do when an Excel file is locked?
Notify opens the workbook read-only and asks Excel to tell you when the other person closes it. When the lock is released, Excel lets you switch to editing. Keep your read-only copy open until then, and don’t type changes into it expecting them to merge, because the read-only copy can’t be saved over the original.
Why can I edit a file in Excel for the web but not in the desktop app?
Usually the desktop app isn’t a co-authoring version, such as Excel 2019 or Excel LTSC 2021, or it’s signed in with a different account from the one that has access. Opening a downloaded copy or an email attachment instead of the cloud file causes the same result. Use Microsoft 365 Excel, which needs a license that includes the desktop apps, and open the workbook from the library, Teams or your OneDrive folder.
Will AutoSave overwrite my colleague’s changes?
Not in normal co-authoring. Each person’s changes merge into the same file within seconds. When two people change the same cell, the last saved change generally wins. If you want to try something without others seeing it, Microsoft suggests File > Save a Copy before you start, or turning AutoSave off for that file and saving manually when you’re ready.
Why does my Excel file say locked for editing by another user after a power cut?
A power cut, crash or dropped network connection can stop Excel cleaning up after itself, so the owner file or the server’s record of the open file survives. Once the PC is back up, wait a few minutes, check that nobody really has the file open, then remove the leftover owner file or have the server close the stale session.
How long does an Excel file stay locked for editing?
It depends on what holds it. A colleague’s lock lasts until they close the workbook. A lock in your own name on OneDrive or SharePoint usually clears a few minutes after you close the file on every device, once the server releases it. A disconnected Remote Desktop session keeps the file open until someone signs that session out. A checked-out SharePoint file stays reserved until it’s checked in, and a stale session on a file server lasts until the server drops it or an administrator closes it.
