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.
Written by Allen Wyatt (last updated September 6, 2021)
This tip applies to Excel 2007, 2010, 2013, and 2016
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.
Save Time and Supercharge Excel! Automate virtually any routine task and save yourself hours, days, maybe even weeks. Then, learn how to make Excel do things you thought were simply impossible! Mastering advanced Excel macros has never been easier. Check out Excel 2010 VBA and Macros today!
When you create a workbook that is read-only, users can still make changes to the workbook. When they exit, they are ...
Discover MoreExcel keeps track of a range of stats about each workbook you use. If you want to take a look at those stats, it's easy; ...
Discover MoreNeed to open a bunch of workbooks from within Excel? It's easy to do when you construct a selection set in the Open ...
Discover MoreFREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
2022-11-27 15:02:13
Tomek
Still it is best to rename one of the files and save yourself from confusion and any problems with PERSONAL.xlsb
2022-11-27 14:58:58
Tomek
In the past it was easier to open two instances of Excel, sometimes selecting multiple Excel files in File Explorer would open them in more than one instance of excel, which caused other problems. Newest version of Excel (MS365) generally opens all files in the same instance, and opening additional files directly from File Explorer causes them to be in the same instance.
The way around it is to run Excel /x command (J. Woolley's suggestion), start a new instance of Excel following instructions from A DuPreez, or run Excel as administrator as Marc suggested.
2022-11-26 05:01:52
Willy Vanhaelen
You can avoid the Personal.xls error by making it a custom add-in. See: https://excelribbon.tips.net/T008529_Using_Custom_Add-Ins
2021-09-08 11:23:04
Mark
If I use the Windows Start menu to open Excel by typing exc, then enter I still get the same error about another file of the same name. I have to right click on Excel in the Start menu and run as administrator for it to work!
2021-09-07 11:07:00
A DuPreez
One can also open the same workbook with 2 instances of Excel. One would be read-only but allows you to make changes separate from the other opened version. (right-click the Excel icon on Taskbar, then click Excel while holding ALT-X)
2021-09-06 11:35:37
Mandora
While it may be technically possible to have two Excel files with the same name open at the same time, it seems an unwise practice to have identically named files. Standard practice should be distinct file names, eg: xyz_2020, xyz_2021 or xyz_JAN21, xyz_FEB21, etc. There is no work around and no confusion about which file you are working in or referring to.
2021-09-06 04:32:04
Philip
Note for the Mac users : only one instance of Excel can be open … so renaming the file is the way to go …
2020-09-21 08:22:21
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
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
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