Why am I getting 'File in use by Another User' and 'Application Sharing Violation' errors when trying to open & and save files?

Solution 1:

OK, after tracking down potential problems and testing solutions since this question was posted I have the answer...

Anything that accesses files in real time (antivirus, syncing, or indexing software) can potentially create problems with Microsoft Office files.

Microsoft Office creates temp (with and without a file extensions) files when saving. Overzealous realtime scanning programs sometimes see these temp files, try and read their contents, and in doing so initiate file locks. This causes instant problems when the parent application tries to convert the temp file back to its intended format.

From MSKB: Description of the way that Excel saves files

When Excel saves a file, Excel follow these steps:

  1. Excel creates a randomly named temporary file (for example, Cedd4100 with no file name extension) in the destination folder that you specified in the Save As dialog box. The whole workbook is written to the temporary file.
  2. If changes are being saved to an existing file, Excel deletes the original file.
  3. Excel renames the temporary file. Excel gives the temporary file the file name that you specified (such as Book1.xls) in the Save As dialog box.

From MSKB: Description of how Word creates temporary files

A simplified view of the scheme used to save an edited file

Create temp file
Write temp file
Delete original file
Move temp to target name

Word gains significant performance speed by placing the temporary file in the same directory as the saved file. If Word placed the temporary file elsewhere, it would have to use the MS-DOS COPY command to move the temporary file from the other directory to the saved location. By leaving the temporary file in the same directory as the saved document file, Word can use the MS-DOS MOVE command to quickly designate the temporary file as the saved document.


Most av, indexing, and syncing software handle the temp files correctly; some don't. And some work fine on their own but not well together when watching the same folder. It's up to you to figure out what program is causing the issue in your environment. Hopefully this answer gives a guiding light in the right direction.

Update: Microsoft has released a couple hotfixes to address this issue.
Office 2007 Hotfix
Excel 2007 Hotfix
Instead of requesting the hotfixes from MS, search for them at The Hotfix Share.

FYI: Neither completely solves our problem but they do significantly reduce "sharing violation" frequency.

Solution 2:

Something that I've noticed using Windows Vista is that it does 'lock' files at random.

I use Unlocker to show me where it is locked and it allows me to unlock the file.