Who Has the Workbook Open?

by Allen Wyatt
(last updated May 10, 2022)

5

Kim's workbook is saved on a network drive and multiple users access it all day long to update the information. Sometimes she tries to access the workbook and it is already open by someone else. Excel used to tell her who had the workbook open so she could go to them and ask them to close it. Now Excel just says the same, never-changing person has it open, even when it is someone else who has it open. Kim wonders why this would be happening all of a sudden.

To figure out why this is happening, it is necessary to understand how Microsoft handles the "naming" of who has a workbook open in Excel. When you open a workbook that nobody else has open, Excel creates a "temp file" that is used to indicate you have that file open; it contains your username, as configured within Excel. When someone else comes along and tries to open the same workbook, they are shown your username, as stored in that temp file.

If you are seeing the same name over and over again, then there are two possibilities. The most likely possibility is that you have a bunch of people all on the same network and none of them have configured their copies of Excel with their unique usernames. This isn't as uncommon as you might imagine; Office 365 subscriptions are notorious for this. During installation, you aren't asked for a username (like you were in previous versions of Office), so the program defaults to a generic name. If people don't go in and change the name, then everyone will have the same name, and it is the same name shown when Excel tries to open a workbook that someone else already has open.

The solution to this problem, of course, is to have everyone customize their version of Excel to include their username. Follow these steps:

  1. Display the Excel Options dialog box. (In Excel 2007 click the Office button and then click Excel Options. In Excel 2010 or a later version display the File tab of the ribbon and then click Options.)
  2. At the left side of the dialog box click General. (If you are using Excel 2007, click the Popular option instead.) (See Figure 1.)
  3. Figure 1. The General options of the Excel Options dialog box.

  4. Change the name shown in the User Name field.
  5. Click on OK.

Remember that each person on the network needs to do this. Now, when they start using Excel workbooks on the network, it is the name specified in step 3 that is stored in the temp file and displayed to anyone else trying to open the workbook.

Earlier I mentioned there were two possibilities. The other one is that, somehow, the temp file associated with a particular workbook isn't getting deleted as it should. (It should be automatically deleted when the original user closes the workbook.) This can be solved by having everyone close Excel, and then someone with administrative privileges going in and deleting any temp files located.

Deleting the files is easy, once you can find them. I mention this because the files are marked as hidden system files (by Office), and they are not normally visible when you are navigating through your various folders. You can configure Windows to display these types of files by following the steps detailed in this tip.

You can tell that a file is a lock file by the fact that it starts with a tilde and a dollar sign. For instance, if you are working on the workbook MyBook.xlsx, then the lock file for that workbook would be ~$MyBook.xlsx. Provided that nobody is actually using MyBook.xlsx, you can delete ~$MyBook.xlsx with no problems.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (13566) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Changing Label Printing Order

If you want to change the order in which labels are printed when doing a mail merge, Word doesn't provide many options. ...

Discover More

Unprotecting Groups of Worksheets

Unprotecting a single worksheet is relatively easy. Unprotecting a whole lot of worksheets is harder. Here's how you can ...

Discover More

Printing Workbooks in a Folder

This tip presents two techniques you can use to print multiple workbooks all at the same time. Both techniques involve ...

Discover More

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!

More ExcelTips (ribbon)

Turning Off Sharing

All good things must come to an end at some point. When you are done sharing your workbook with others, this is how you ...

Discover More

Sudden Increases in Workbook File Size

Workbooks can get rather large rather quickly. If you think your workbook has gotten too big too fast, here are some ...

Discover More

Changing Links

If your worksheet is linked to data in other worksheets, you may need to change the link from time to time. Here's how to ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is four less than 6?

2022-05-14 12:15:14

Tomek

Clarification of my previous comment.
Two Comments:
1. The file ~$Name.xl?? can be open in a text editor and you will see the name or, if shared, names of people who are using the related spreadsheet. Sometimes you need to copy it first as the system may not allow you to open a file that is used by other processes.
2. Such "temp file" is not created when the spreadsheet is located on OneDrive or SharePoint. However such files can be usually opened by more than one person at the same time. ***I meant, files from OneDrive or SharePoint.***


2022-05-14 12:12:03

Tomek

Two Comments:
1. The file ~$Name.xl?? can be open in a text editor and you will see the name or, if shared, names of people who are using the related spreadsheet. Sometimes you need to copy it first as the system may not allow you to open a file that is used by other processes.
2. Such "temp file" is not created when the spreadsheet is located on OneDrive or SharePoint. However such files can be usually opened by more than one person at the same time.


2022-05-11 11:27:58

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 workbook open.
In older versions of Excel you can use ListUserStatus with the SpillArray function like this:
=SpillArray(ListUserStatus([SkipHeader]))
SpillArray will determine and populate the spill range for its array expression argument, simulating a dynamic array.
See https://sites.google.com/view/MyExcelToolbox/


2022-05-10 07:40:32

RKeev

Like ur code, i was using a txt file named Log and the below, but if they don't enable macros.........it's moot.
Private Sub Workbook_Open()
If InStr(LCase(Application.UserName), "yourname") > 0 Then Exit Sub 'so it doesn't do it for you
Dim SLUSH As String
On Error GoTo Procend
SLUSH = ThisWorkbook.Name
Open "C:\urfolder\Log.txt" For Append As #1
Print #1, SLUSH & ", Started " & Now & " " & Application.UserName
Close #1
Procend:
End Sub


2022-05-10 07:19:13

ESeb

One solution with a specific sheet, "who open the workbook."

Sub Workbook_Open()
Call SheetLOG("HereSheetNameLoginOfTheWorkbook", "Entrance")

'And the rest of the Sub
End Sub

'---------------------------------------------------------------------------------------
' Procedure : Sub SheetLOG(Wks As Sheets, sInOut As String)
' Author : ESeb
' Date : 2007...
' Purpose : populates an array with connection data : hour, date, author, PC, Version...
'---------------------------------------------------------------------------------------
' Version Date Descriptions
' 1.00.00 2007-05-14 Code d'origine
' 1.00.01 2017-11-16 Correction gros bug empêchant l'affichage sur la feuille
'---------------------------------------------------------------------------------------
Sub SheetLOG(sSheetName As String, sInOut As String)
Dim RngDernLign

On Error Resume Next

'--- Goto the last line in column "A"
Set RngDernLign = Worksheets(sSheetName).Range("A1").End(xlDown)

'--- Populate the Listobject
RngDernLign.Offset(1, 0).Value = sInOut
RngDernLign.Offset(1, 1).Value = Now()
RngDernLign.Offset(1, 2).Value = Environ("USERNAME")
RngDernLign.Offset(1, 3).Value = Format(ThisWorkbook.CustomDocumentProperties("Version").Value, "00\.00\.00")
RngDernLign.Offset(1, 4).Value = Environ("COMPUTERNAME")

'--- Clear
Set RngDernLign = Nothing
End Sub

a solution ?

ESeb


This Site

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.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.