Written by Allen Wyatt (last updated February 2, 2024)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365
Every time Kevin opens one particular Excel workbook, he sees a notice that the "file is in use" and is locked for editing, with the username being his own. He knows he doesn't have this workbook open. He's saved the workbook under a new name, but he still gets the same "in use" message when opening the new file.
There are a couple of things that may be causing the issue. The first thing to check is to get out of Excel and see if there is a "semaphore file" for the workbook. When you first open a workbook, Excel creates the semaphore file to indicate that the workbook is in use. This file is essentially the name of the opened workbook preceded by a tilde and a dollar sign. Thus, if you open a file named MyFile.xlsx, then the semaphore file will be named ~$MyFile.xlsx.
The semaphore file should be automatically deleted when you close the workbook with which it is associated. If something interferes with deleting the semaphore file, then the next time you open the workbook, it will show as "in use."
Go ahead and get out of Excel, then use Explorer to navigate to the folder in which the workbook is stored. Check to see if the semaphore file is in that folder. In order to see any left-over semaphore files, you'll need to make sure you have Windows configured to display all hidden files. (Semaphore files are hidden, by default.) If you see the file, simply delete it, and you should be fine on restarting Excel.
Another possible cause of the problem is the way that Windows Explorer interacts with files. A popular way to use Explorer is to leave the Preview pane open at the right side of the Explorer window. With the pane turned on, you are shown a preview of whatever file you have selected in the Explorer window. In order to display the preview, Explorer must open the file, and this can cause "false positives" if you have a workbook selected and you try to open the workbook through Explorer.
The solution in this situation is to simply get out of Explorer and open the workbook or close the Preview pane in Explorer. Either way should allow you to open the workbook just fine.
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (13692) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365.
Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!
Ever want to see a list of all the workbooks that are open? If you open more than nine, Excel only displays the first ...
Discover MoreExcel has the capability to automatically open workbooks when you first start the program. You may not want to have one ...
Discover MoreIf you have a workbook with lots of worksheets, you may want those worksheets to be saved off in individual workbooks. ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
2024-02-03 10:58:32
J. Woolley
My Excel Toolbox includes the following dynamic array function:
=ListUserStatus([SkipHeader])
This function lists name, last activity (date/time), and type (exclusive/shared) for each user that has the formula cell's workbook open.
When using pre-2021 versions of Excel without support for dynamic arrays, review the PDF file UseSpillArray.pdf.
See https://sites.google.com/view/MyExcelToolbox
Also, see https://excelribbon.tips.net/T013566_Who_Has_the_Workbook_Open.html
2024-02-02 07:43:53
Brian
When working on a network it can be useful to know if another user has a file open then who it is. From VBA it's easy to check if a semaphore file exists. If it does then the first byte will be a number and that subsequent bytes will be the name of the user as held in the Excel variable 'Application.Username' and held by the OS. So if for example the first 12 bytes of the semaphore file say 'Allen Wyatt'. Where is the character code for 11 - there's your user. I haven't yet managed to decode the other 153 bytes (it's always 165 bytes long).
2019-10-28 14:26:31
Christian Sommerhuber
Nice article, but I think the most frequent possibility is missing: when Excel crashes (what I see often) then the Excel task may still be active, although you can't see it on the screen. You need to start the task manager and if the task still persists you need to kill it in the task manager.
2019-10-26 17:03:24
David Gray
Thanks to the other subscribers who contributed to this article, I learned about another potential cause of this "in use" error. Since I have never used the Preview Pane, I've never experienced this variant, nor would it have crossed my mind.
2019-10-26 13:02:10
Raymond Wixom
When I have the Preview Pane open and try to save a file, I get a message that I have to rename the file or save it somewhere else. Close Preview Pane and I can save the file without further problems.
Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2024 Sharon Parq Associates, Inc.
Comments