14

Related (but not the same): Open Excel files in new window

If I've got an instance of Excel with multiple documents open in the same window. Is there a way to "tear off" one of the windows in the current running instance of Excel so that it's in an entirely different window?

What does not fit the bill:

  • Arrange all/view side by side/other MDI stuff; I want a separate window which can be maximized separately on another monitor and is managed by the window system differently, etc.
  • Saving/closing it in the running instance and then opening a new instance of Excel and opening the file there (this is what I currently do, but it's a pain)

edit: target Excel version is 2007 and 2010, though anything will do

5
  • Can't help you but I've seen both in Excel: Everything in one window (MDI like) and each sheet one window. Did you check the prefs? Maybe it's an option? Apr 26, 2011 at 19:35
  • 1
    @Aaron that may be acceptable and would at potentially be better than what I've got now, but I'm not seeing that option anywhere Apr 26, 2011 at 20:50
  • 1
    Microsoft be damned for locking me into a single Excel window! Isn't your OS called Windows - plural? Welcome to Window 7!
    – dunxd
    Jun 13, 2012 at 9:36
  • @dunxd - it's funny reading that "old" comment now since, here in the future, there are constantly users complaining that Excel opens each workbook in a separate window.
    – ashleedawg
    Oct 3, 2018 at 11:41
  • Now tabbed windows like in Chrome that can be "torn off" or recombined is the best of both worlds. Great UI step forward.
    – dunxd
    Oct 4, 2018 at 14:04

4 Answers 4

4

Interesting idea. I'm reasonably confident that you cannot do this without a custom macro. Being a rainy Sunday...

Sub OpenInNewInstance()
     Dim objXLNewApp As Excel.Application
     Dim doc As String

     doc = ActiveWorkbook.FullName
     ActiveWorkbook.Close True

     Set objXLNewApp = CreateObject("Excel.Application")

     objXLNewApp.Workbooks.Open doc
     objXLNewApp.Visible = True
End Sub

Assuming you're not familiar with VBA, you'd need to:

  1. Copy the code above
  2. With a new Excel workbook opened, open Excel's VBA editor (Alt+F11)
  3. Right-click on VBAProject (Book1) (or whatever it's called in the left menu)
  4. Select Insert > Module
  5. Paste in the code into the main window
  6. Back in Excel, select another workbook to test the code on (it'll save the workbook before it closes it)
  7. Go back to VBA editor, select the module you pasted in and press the play button

I have 3 versions of Excel installed on my machine, and when I run this in Excel 2010, it opens a new instance of Excel 2003.

If this suits your needs, you could package this into an add-in and have it available as a ribbon button. Let me know and I can help out if you're unfamiliar with doing so.

Edit: If this approach works for you, obviously there would be some additional code to add in that would ensure the new instance of Excel is maximized in another window. Let me know.

2
  • This is perfect! (Given the circumstances of having to use Excel 2010, that is) Oct 15, 2014 at 9:04
  • Or you could just right click on the Excel icon and click Microsoft Excel, which opens a new instance (which is essentially what the code above seems to be doing). What I have done (by accident, can't figure out how to repeat it) is opened up an Excel workbook outside of the existing application's MDI (effectively letting me have that workbook in a separate window) but still able to interact with other workbooks (for vlookups in my main MDI (vlookups, etc.).
    – William
    Jun 26, 2015 at 19:30
3

I don't have a way to "tear off" a sheet into a new window, but if you know from the start that you'll want two windows, this is the quickest way:

Open your first file as normal. SHIFT + CLICK the Excel task bar button (at the bottom of your screen, between the Start button and the clock). This will force Excel to open a new instance as a separate window. Go into that new window and click File -> Open to open the second file. Rinse and Repeat as needed for multiple windows.

Unfortunately, if you like to double-click on files to open Excel, you'll have to break that habit for the second window, which is my usual problem. But with some forward thinking, there's no easier way.

0

To open 2 instances double click the first file you wish to open. Once that is open go to start/programs/msoffice/excel and just open another instance from there. Then you can use File/open It works for me. If it doesnt have a look at the Folder Options>File types, XLS, Advanced & check the Open form.

3
  • I specifically mentioned that I already do this. Apr 26, 2011 at 22:37
  • Ok apologies I was getting my windows and instances mixed up. And I suppose that you have tried maximizing excel across both monitors and then view-->new window which allows you to manage that window separately?
    – Dave
    Apr 26, 2011 at 22:51
  • View > New Window just creates a new window within that same instance, not a new non-MDI window. Apr 27, 2011 at 0:29
0

The answer above would probably work with a workbook other than the active workbook, which is what I needed to do. Here's what I used


Ensure on startup that workbook is alone in instance:

Private Sub Workbook_Open()
    If Application.Workbooks.Count > 1 Then  'check if there's >1 open wb's in this instance
        If MsgBox("This workbook will be moved to a new instance of Excel," & vbLf & _
            "so as to not affect performance of your other workbooks.", _
            vbOKCancel + vbInformation + vbDefaultButton1 + vbMsgBoxSetForeground) _
            = vbCancel Then Exit Sub
        Debug.Print Application.Hinstance, "Moving wb to new instance."
        OpenInNewInstance
        Debug.Print Application.Hinstance, "Moved wb to new instance."
    Else
        Debug.Print "This wb is in it's own instance. (#" & Application.Hinstance & ")"
    End If
End Sub

Sub OpenInNewInstance()
    With ThisWorkbook
        .Save                                           'save workbook before making it read-only
        .ChangeFileAccess xlReadOnly                    'make this wb read-only (so the other isn't)
        Shell ("excel.exe /x """ & .FullName & """")    'open current wb in new instance
        .Close                                          'close this workbook
    End With
End Sub

This code goes in the ThisWorkbook module, so that when the workbook is opened it immediately checks to see if it's the only workbook open in this instance, and if not:

  1. Save current workbook
  2. Set current wb as read-only (to prevent a 2nd copy from being an issue)
  3. Shell to command prompt to open Excel in a new instance (using Excel's /x command line switch), loading another instance of the current workbook
  4. Close current workbook

If necessary you could use a custom command line when opening the new instance to transfer instructions, etc, to the new instance. You could also consider the pro's and con's of hiding the application window for the new instance.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .