Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, and 2016. 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: Opening Two Workbooks with the Same Name.

Opening Two Workbooks with the Same Name

by Allen Wyatt
(last updated March 5, 2016)

4

It is not unusual to have two workbooks, located in different folders that have the same name. For instance, you could have two folders, one named "Year 2015" and another named "Year 2016." Both folders could contain a workbook file named Budget.xls.

Opening one of the Budget files in Excel is easy. If you try to open the second Budget file while the first is already open, Excel will generate an error. It does this because many of the internal functions used by Excel don't rely on a full path name for their operation, but instead look at only the name of the workbook. Having two workbooks open with the same name would cause these internal functions to become confused. The solution—don't let Excel open the second file that has the same name.

There are a couple of ways around this, however. The first (and obvious) workaround is to rename one or both of the workbook files. In the example above, you could name one file Budget2015.xls and the other Budget2016.xls. With different names, the workbooks will open just fine.

The second workaround is to just open a second instance of Excel. In other words, when you want to open the second Budget file, don't do it by choosing Open from within the program. Instead, use the Windows Start menu to start another copy of Excel. Because of the way that memory and programs are handled by Windows, neither copy of Excel is aware of the other. Thus, you could open the different Budget files (each with the same name) in each of the instances of Excel.

There is one potential glitch if you open a second instance of Excel. If there are workbooks that are automatically opened when Excel starts (such as Personal.xls), then you may see a warning or error message when you start the second instance of Excel. In most cases this won't cause any problem—at least it doesn't with Personal.xls. If you have other workbooks that are automatically opened, you will need to do some testing to see if there are any problems evident. (Potential problems can vary, depending on the content and programming inherent in the workbooks being automatically opened.)

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (11926) applies to Microsoft Excel 2007, 2010, 2013, and 2016. You can find a version of this tip for the older menu interface of Excel here: Opening Two Workbooks with the Same Name.

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

Automatically Adding Tabs in Footnotes

When you add a footnote to a document, Word's normal formatting adds a space after the footnote number and before the ...

Discover More

Breaking Up Variable-Length Part Numbers

Part numbers can often be long, made up of other component elements. Breaking up part numbers into individual components ...

Discover More

Using Find and Replace to Pre-Pend Characters

Need to add some characters to the beginning of the contents in a range of cells? It's not as easy as you might hope, but ...

Discover More

Professional Development Guidance! Four world-class developers offer start-to-finish guidance for building powerful, robust, and secure applications with Excel. The authors show how to consistently make the right design decisions and make the most of Excel's powerful features. Check out Professional Excel Development today!

More ExcelTips (ribbon)

Problems with Default Workbook and Worksheet Templates

You can create a default template for both your workbooks and worksheets. These should be placed in the XLSTART folder, ...

Discover More

Making Ribbon Customizations Apply to All Workbooks

Excel allows you to easily make changes to the ribbon, as well as to the Quick Access Toolbar, which is near the ribbon. ...

Discover More

Forcing a Workbook to Close after Inactivity

Tired of your workbooks being left open on the screen where they can be seen by anyone passing by? Here's a way to have ...

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}] 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 seven more than 6?

2020-09-21 08:22:21

Nick DeMarco

Thanks for the two alternatives. I can see you spent some time thinking about this, which likely means there's no easy workaround. I've forwarded these to the individual with the problem, as I don't know what I'm doing with VB (or command lines for that matter). Your efforts are truly appreciated!


2020-09-19 12:46:34

J. Woolley

@Nick DeMarco
You can also use Excel's /x command line switch to open a new instance:
excel.exe /x "c:\my folder\book1.xlsx"


2020-09-19 10:55:19

J. Woolley

@Nick DeMarco
This VBScript named OpenExcelFile.vbs will open each file in a different instance of Excel.

' Open an Excel file: OpenExcelFile.vbs CompleteFilepath
' Sep 2020 by J. Woolley, https://sites.google.com/view/MyExcelToolbox/
Set oArgs = WScript.Arguments
If oArgs.Count = 0 Then WScript.Quit
Const xlMinimized = -4140
Const xlNormal = -4143
With WScript.CreateObject("Excel.Application")
.WindowState = xlMinimized
.Visible = True
.Workbooks.Open(oArgs(0))
.WindowState = xlNormal
End With

The default app for filetype vbs is normally wsh.exe (Windows Script Host).
Make a shortcut to each Excel file that has a duplicate name, then edit the shortcut's Target property to add the full path of OpenExcelFile.vbs before the Excel file's path (separated by a space character). Use quotation marks when necessary.


2020-09-18 12:27:27

Nick DeMarco

Hi, Allen! Nick DeMarco from Philadelphia Gas Works - we've exchanged emails a few times over the years.

Here's the hiccup - we're running O365 (Excel 365) on Windows 10 (new to us). Disregarding your suggestion about renaming one of the files, I had told my colleague the same thing you wrote - open a new instance of Excel and open the file with the same name in that. However, for whatever reason (Win 10, Excel settings, the phase of the moon), when we go to open the same named file from a different location in the new window, with the other file already open in the first window, Excel errors anyway ("Cannot open two files with the same name..."), on top of the Book 1 of the new window.

Is there a more effective way to open the "new" Excel window from the old one? (i.e., "cordon off" the Excel windows from each other?) I checked Excel's options to see if there was a toggle that forced newly opened Excel workbooks into "new" windows, which I remembered seeing in older versions, but now I don't see it. Every other way I've tried to "open" a separate and distinct Excel workbook window seems to work, but the above error persists. Advice?

Nick DeMarco


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.