Please Note: This article is written for users of the following Microsoft Excel versions: 2007 and 2010. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Locked File Puzzle.

Locked File Puzzle

Written by Allen Wyatt (last updated December 14, 2023)
This tip applies to Excel 2007 and 2010


7

Eric was having a problem with one of his workbooks. It seems that every time he opened the workbook he saw a dialog box that said the file was locked and that he would have to save changes under a different name. Even when he does that, the dialog box still appears on the new workbook.

The first thing to try is to restart your machine, or copy the workbook to a different folder on your system. The reasoning for this is simple: Sometimes Excel can get confused and think that a file is "locked" by another user, when in fact it is not. Restarting or copying the workbook can help clear the confusion.

The most likely cause of this problem, however, is that there is some sort of macro running when the workbook is opened. Even if you save the workbook under a different name, the macro would be saved with the new workbook, and the process would repeat itself all over again. To test this, try the following:

  1. Open the workbook like normal, dismissing the dialog box.
  2. Select all the worksheets in the workbook. (Click on the left-most worksheet, then hold down the Shift key as you click on the right-most worksheet.)
  3. Right-click the selected worksheet tabs and choose Move or Copy from the resulting Context menu. Excel displays the Move or Copy dialog box. (See Figure 1.)
  4. Figure 1. The Move or Copy dialog box.

  5. Using the To Book drop-down list, choose (new book).
  6. Make sure the Create a Copy check box is selected.
  7. Click OK.

Now you have two workbooks: the one you opened and a new, unnamed workbook. Close the original workbook without saving, and then save the new workbook under any name desired. You should be able to open the new workbook with no problems, as macros are not copied in the above steps.

If you cannot complete step 3 because the Move or Copy Sheet option is not available, it means that the worksheets have been protected. You would need to remove protection from the worksheets before you could copy them.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (11283) applies to Microsoft Excel 2007 and 2010. You can find a version of this tip for the older menu interface of Excel here: Locked File Puzzle.

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

X-Axis Dates Lose Formatting

Excel makes it easy to copy charts from one workbook to another. Even so, copying may produce some surprising results for ...

Discover More

Removing Shortcuts for Macros

Word apparently has a bug in it that makes it very difficult to remove a shortcut key previously associated with a macro. ...

Discover More

Sharing Macros with Others

If you develop some handy macros that you use on your system, you may want to share those macros with others. This tip ...

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)

Aligning Cells when Importing from CSV

When you import information from a CSV text file, Excel formats the data according to its default settings. Wouldn't it ...

Discover More

Getting Rid of Empty Rows after Importing

Import data into a worksheet (or paste it there) and you may find that you end up with a group of blank cells you need to ...

Discover More

Appending to a Non-Excel Text File

Does your macro need to add information to the end of a text file? This is called appending and is done using the ...

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 nine minus 5?

2015-03-16 09:56:13

Charley

To Dave Smith: Right clicking on a sheet tab opens a context menu. One of the options is "Select all sheets" . . .

To Greg Van Hook: Thanks! That has been driving me and the IT staff crazy.


2015-03-15 22:38:23

Santosh Rodrigues

Good tip. Very useful and it works well.


2015-03-13 12:05:31

Neil

Wow Greg, thanks for the tip...it's nice to have my double-click back! It wasn't a huge deal because right-clicking and choosing "Open" would usually work, but even then it would sometimes take two attempts.


2015-03-13 09:52:42

Greg Van Hook

I have been having an issue where the workbook opens with the message that it is locked "by another user." After some research we discovered that there was a windows bug and if you go to file explorer and click the organize dropdown and then the layout option you can turn off the details pane and preview pane and it solved the issue.


2015-03-13 07:05:50

Dave Smith

To quickly select worksheets click on the first sheet, hold down CRTL+SHIFT, then press and hold PAGE DOWN to select sheets to the right of the first sheet (use PAGE UP for sheets to the left of first sheet). This works in Excel 97 SR-1


2012-02-13 08:34:05

The Xcel Masters

Waw, that is a handy tip! "ll surely apply it and give further feedback. Thank you very much.


2012-02-11 16:27:34

Fola

Sir, I will appreciate if you can suggest what could be the solution to my excel 2007 workbook, I have problem using the shortcut menu. I meant, my right click menu does not come up anytime I try to use short cut menu for any operation.


Many thanks,

Afolabi


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.