Excel Share Violation: Fixes & Causes

How-to basics · Updated November 22, 2026

An Excel share violation error means another user (or another process on your own computer) has the workbook open, and Excel cannot write to the file because it is locked. The fix is to close the other copy, wait a few seconds for the lock to clear, or copy the file to a new location and work from that copy.

What Causes a Share Violation in Excel?

Excel uses file locking to prevent two people from overwriting each other’s changes. When you open a workbook, Excel creates a hidden lock file (with a name like ~$Book1.xlsx) in the same folder. That lock file tells other copies of Excel that the file is in use. A share violation appears when Excel tries to save but cannot access the file because the lock is still active or because the file is open in another program.

Common triggers include:

  • Another user has the file open in Excel, and you are trying to save over it.
  • You have the same file open in two Excel windows or in two instances of Excel.
  • A previous Excel crash left a stale lock file behind.
  • The file is stored on a network drive with slow sync or a temporary glitch.
  • Antivirus software is briefly scanning the file and holding it open.

How Excel’s File Locking Works (and Why It Fails)

When you open a workbook, Excel writes a lock file that contains your username and computer name. When you save, Excel checks that lock file to confirm it still owns the file. If the lock file is missing, Excel may show a “file in use” or “share violation” message. If the lock file exists but belongs to another user, Excel blocks your save to prevent data loss.

The problem is that lock files are not always cleaned up. If Excel crashes or the network connection drops, the lock file can remain in the folder. Excel then thinks the file is still open, even though no one is using it. This is why a share violation often persists after everyone closes the file.

How to Fix a Share Violation (Step-by-Step)

Try these in order, from simplest to most thorough:

  1. Close all copies of the workbook. Check both Excel windows and any other device (like a tablet) that might have it open.
  2. Wait 10–30 seconds. Sometimes the lock file is released with a slight delay, especially on network drives.
  3. Look for a lock file. In the same folder as the workbook, look for a file starting with ~$. If you are certain no one else has the file open, delete that lock file.
  4. Copy the file to your local drive. Copy the workbook to your desktop, open that copy, and save it. Then copy it back to the network location if needed.
  5. Rename the original file. If the lock file won’t delete, rename the workbook (e.g., from Report.xlsx to Report_new.xlsx) and open the renamed copy.
  6. Check for a hidden instance of Excel. Open Task Manager (Ctrl+Shift+Esc), look under Processes for multiple Excel.exe entries, and end the ones that are not responding.

Preventing Share Violations in Shared Workbooks

If multiple people regularly work on the same file, the best prevention is to use Excel’s built-in co-authoring feature. Co-authoring is available in Microsoft 365 and Excel for the web. When you store the file in OneDrive, SharePoint, or Teams, multiple users can edit the same workbook at the same time without lock conflicts. Excel handles merging changes automatically.

If you must use a traditional shared network folder, follow these rules:

  • Only one person should edit at a time; others can open it read-only.
  • Use File > Info > Protect Workbook to mark the file as final or require a password to modify.
  • Turn on Track Changes (Review > Track Changes > Highlight Changes) if you need to see who changed what, but note that this feature is being phased out in newer versions.
  • Avoid storing Excel files on a USB drive or a folder that syncs constantly (like Dropbox) if multiple people are editing simultaneously.

Common Misconception: The “Share Workbook” Button

Many users think the “Share Workbook” button (Review > Share Workbook) is the solution. That legacy feature (available in Excel 2016 and earlier) actually creates a shared workbook that allows multiple users to edit, but it has limitations and is not recommended by Microsoft. It can cause conflicts and is not the same as co-authoring. In Microsoft 365, the Share button (top right) is the correct way to collaborate.

If you are using an older Excel version and see a share violation, the legacy Share Workbook feature might be enabled. To turn it off, go to Review > Share Workbook, uncheck “Allow changes by more than one user at the same time,” and click OK.

Share Violation on Save vs. Open

A share violation can appear when you open a file or when you save it. When opening, it usually means the file is locked by another user or a stale lock file exists. When saving, it means Excel cannot write to the file because the lock is active or the file is read-only. The fix is the same: clear the lock, close other copies, or save to a new location.

If you get a “file in use” dialog with options like “Read Only,” “Notify,” or “Cancel,” choosing “Notify” lets you open a read-only copy and then receive a notification when the file becomes available. That is a safe way to view the data without causing a conflict.

When the File Is Locked by Another Program

Excel is not the only program that can lock a file. If you have the workbook open in a PDF viewer, a text editor, or even a cloud sync client, that program might hold a lock. Close all other programs that might have the file open. Also, check if the file is open in Excel on your phone or tablet—that counts as another user.

If you are on a Windows network, a user might have the file open on a computer that is now off, leaving a lock. In that case, ask your network administrator to release the lock or wait for the server to time out.

Frequently Asked Questions

Why do I get a share violation even when no one else is using the file? This usually happens because a lock file (~$filename.xlsx) was left behind after a crash. Delete the lock file if you are sure the file is not in use. On a network, the server may also take time to release the lock.

Can I force Excel to ignore the lock and save anyway? No. Excel will not let you overwrite a locked file because doing so could corrupt the workbook or lose changes. You can save a copy under a different name, but that creates a separate file.

Does the share violation happen on Mac or Excel for the web? Yes, but less often. On Mac, the lock file is hidden and may not be visible in Finder. Excel for the web uses server-side locking and usually shows a “This file is locked for editing” message instead of a share violation.

Is there a way to see who has the file open? In Excel 365, go to File > Info and look for “Manage Workbook” or “Show who has it open.” On a network share, you can use Windows Admin Center or the command prompt to see open files, but that requires admin rights.

Will turning off my antivirus fix the share violation? Sometimes. Antivirus software can briefly lock files during a scan, so temporarily disabling it (or adding the folder to exclusions) can help. But do not leave your antivirus off permanently—that is a security risk.

Related

Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.

More in How-to basics

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.