22

I have been using virtual desktops in Windows 10 for a while. It works fine, the only issue I found and would love to solve is as the following scenario:

  • I have Virtual Desktop 1 with Microsoft Excel or Microsoft Word Open on Sheet.xlsx or Doc.docx
  • I have Virtual Desktop 2 and about to open another sheet / document, Sheet2.xlsx or Doc2.xlsx

In this case, it switches to Desktop 1, because it already has Excel / Word open, while I expect it to open on Desktop 2 since I am there. Of course, I could move Sheet2.xlsx / Doc2.xlsx window to Desktop 2, but I have to do it manually from multitasking.

I didn't try other applications, but I would guess it's the same behavior.

Is there anyway to avoid this behavior and have Windows open the other document / sheet in the current virtual desktop?

4 Answers 4

15

Since MS Office 2013, the windows of each Office app run in a single instance of the executable. When an instance opens a new window, Task View first switches to an existing app window. (My other gripe is that multiple UNDO commands backtrack chronologically across multiple windows, which is never what I want.)

Word and Excel

I solved the problem in Office 2016 by using command line options to run each Word and Excel window in a separate instance. For Word, the option is /N; for Excel it is /X. It costs a little extra startup time and a little extra memory. I don't run a lot of windows at once, so for me the reduced aggravation is worth it.

For desktop icons, custom toolbars, and other shortcuts, you can simply edit the properties and add the option to the target command line:

"C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXE" /X "C:\Data\Weather\Weather Log.xls"

Making the option apply when you open a file (e.g. by double-click) is a little harder.

  1. Open a command window running as Administrator.

  2. Find the file type associated with a file extension:

> assoc .xls
.xls=Excel.Sheet.8
  1. Find the command used to open that file type:
> ftype excel.sheet.8
excel.sheet.8="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" "%1"
  1. Replace that command with one that includes the option:
> ftype excel.sheet.8="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X "%1"
excel.sheet.8="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X "%1"
  1. Repeat from step 2 for each file extension you use (e.g. .xlsx). Ones with the same file type need no further change.

You could do a wholesale change by capturing all Excel ftype definitions into a .BAT file, editing the file to add ftype at the start of each line and /X after each .EXE, and (for .BAT scripts) changing %1 to %%1

> ftype | find /i "office16\excel" > ftypes.bat

> [your text editor] ftypes.bat
    (make the changes described above)

Running the resulting script should produce output similar to:

> ftypes.bat

> ftype dqyfile=C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE /X "%1"
dqyfile=C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE /X "%1"

> ftype Excel.Addin="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X "%1"
Excel.Addin="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X "%1"

> ftype Excel.Backup="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X "%1"
Excel.Backup="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X "%1"

> ftype Excel.Chart=C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE /X "%1"
Excel.Chart=C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE /X "%1"

> ftype Excel.Chart.8="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X "%1"
Excel.Chart.8="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X "%1"

> ftype Excel.CSV="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X "%1"
Excel.CSV="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X "%1"

> ftype Excel.Macrosheet="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X "%1"
Excel.Macrosheet="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X "%1"

> ftype Excel.OpenDocumentSpreadsheet.12="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X "%1"
Excel.OpenDocumentSpreadsheet.12="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X "%1"

> ftype Excel.Sheet.8="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X "%1"
Excel.Sheet.8="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X "%1"

> ftype Excel.Sheet.12="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X "%1"
Excel.Sheet.12="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X "%1"

> ftype Excel.SLK="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X "%1"
Excel.SLK="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X "%1"

> ftype Excel.Template="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X "%1"
Excel.Template="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X "%1"

> ftype Excel.Template.8="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X "%1"
Excel.Template.8="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X "%1"

> ftype Excel.Workspace="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X "%1"
Excel.Workspace="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X "%1"

> ftype Excel.XLL="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X "%1"
Excel.XLL="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X "%1"

> ftype Excelhtmlfile="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X
Excelhtmlfile="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X

> ftype Excelhtmltemplate="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X
Excelhtmltemplate="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X

> ftype iqyfile=C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE /X "%1"
iqyfile=C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE /X "%1"

Other Office Apps

Some Office apps, notably PowerPoint, have no option to start a new instance. However, running an app as a different user creates a new instance. So one workaround is to create local Windows users for as many virtual desktops as you want to open PowerPoint on concurrently. This scheme is not ideal, because you have to remember which users/instances you already have running before opening a new one. If you have only a few, it may not be too bad.

To create each user:

Settings > Accounts > Family & Other Users > [+] Add someone else to this PC

  1. I don't have this person's sign-in information
  2. Add a user without a Microsoft account
  3. Enter new Username, Password, and Security Questions

To create a shortcut which starts PowerPoint as a specified user, edit the shortcut's properties to use a command such as:

runas  /user:user2  /savecred  "C:\Program Files (x86)\Microsoft Office\root\Office16\POWERPNT.EXE"

runas prompts for the user's password. /savecred saves the password the first time and uses the saved password subsequently. You may want to initially make each shortcut Run: Normal window, and later change it to Run: Minimized.

These shortcuts could be either on the Windows desktop or in a custom toolbar menu. Once PowerPoint is running, you can either open a PPT file from there, or drag in a file from File Explorer. If you are working on a few PPT files for an extended time, you could create a shortcut for each file, specifying which user to run as.

Opening a PowerPoint Instance from a PPT File

Unfortunately, dragging a PPT file onto one of the desktop shortcuts described above won't work, because runas requires that the full PowerPoint command line be quoted. Shortcuts for opening a PPT file directly need an intermediate script to sort out the quotes. Create a script such as "PowerPoint_User.bat":

:: Usage:  PowerPoint_User  <username>  <PPT filename>
:: Opens a PPT file as a specified user, starting a new PowerPoint instance on
:: the current virtual desktop if that user was not already running PowerPoint.
:: (%~f2 expands %2 to full path with no quotes.  See "call /?".)
@echo off
C:\Windows\System32\runas.exe /user:%1 /savecred "POWERPNT.EXE \"%~f2\""

Then create a shortcut for each user, with a command such as:

C:\bin\PowerPoint_User.bat  user2

If the shortcut is on your Windows desktop, then you can drag a PPT file onto it. If you create the shortcut in %USERPROFILE%\AppData\Roaming\Microsoft\Windows\SendTo, then you can click right on a PPT file and open it from the "Send to" menu. In either case, remember that each shortcut will prompt for a password the first time it is run.

(If you need to debug the shortcut, set it to Run: Normal window, prepend cmd /k to the command, and remove @echo off from the script.)

7
  • I cannot find a new instance switch for PowerPoint.
    – Tjaart
    Oct 22, 2020 at 14:20
  • I cannot find one either. I wrote a script to try every single-letter option, and none worked. The only work-around I found on the web is to create a new Windows user for each additional instance needed, and start PowerPoint with commands such as: -- runas /user:ppt2 /savecred "C:\Program Files (x86)\Microsoft Office\root\Office16\POWERPNT.EXE" -- You could create separate shortcuts for starting instance two, instance three, etc. It's a kluge, but it may be the least ugly one. -- An old reference: pleasemakeanote.blogspot.com/2008/06/…
    – George S
    Oct 23, 2020 at 21:35
  • I expanded my original answer to include some ideas for PowerPoint.
    – George S
    Oct 25, 2020 at 0:16
  • 2
    This is a good work-around for Excel, which is my primary problem. MS should really have a switch for this in the UI though. Dec 9, 2022 at 14:02
  • @GeorgeS This is one of the most intense "I wanna smack the person responsible" moments in my life. I used powerpoint a lot and while the solution is creative and speaks volumes to tenacity of human kind in the face of poor UX design, it is not something I could easily apply to open files like you demonstrate in your answer, right?
    – AturSams
    Feb 6 at 6:13
4

Excel uses the same executable to open sheets, that's why it switches the desktop. The solution is to open a second intstance of Excel:

Go to Desktop 2:

  • Open Start Menu, search for Excel
  • Press ALT + Click on Excel Symbol
  • Press Yes when asked "Do you want to start a new instance of Excel?"

I found that Excel only uses the newest instance to open sheets when opened in the File explorer, even if another instance is selected.

So as a workaround, if you want to later open another sheet on Desktop 1, go to the instance on that desktop (open a new one, if closed) and then click on "File -> Open" to open a new sheet in that instance.

2
  • 1
    Underrated answer in case you need a quick and dirty solution! This default excel behavior is super annoying IMHO. But i must say i can't find any official documentation mentioning this alt-click method of the start menu?
    – PKSWE
    Jan 29 at 13:06
  • 1
    It's not about alt+click. It's about holding alt, while Excel is starting, or while you opened a new file. So just open any file you want, while holding LEFT ALT on your keyboard (in some countries/layouts you have to hold left alt, in other countries it can be any ALT)
    – Artur Iwan
    Aug 30 at 12:02
0

What I have observed is that when you have multiple desktops, and you choose to open a document (from any of these desktops), the OS will:

(i) if the app is not open, it will open in the current desktop.

(ii) if the app is already open, it will open the document in the last activated instance of the app (irrespective of which desktop you click it from)

So if you want to open multiple files of an app (say MS Word), before clicking open, make sure the instance of the app is activated in the current desktop.

I have seen this issue in many forums, I hope they come up with a suitable solution soon.

1
  • Thanks for the information, but what you have provided is the analysis, what is required is to be able to open different instances for different desktops without moving them around, and the answer provided and selected above is the one that satisfies what is required, thanks anyway
    – Yaman
    Aug 15, 2020 at 12:56
0

One solution that allows you to continue to run Excel in a single instance of the executable (and therefore continue to have the ability to copy and paste between workbooks) is to set Excel to be shown on all desktops.

Windows 10:

  1. Open Task View (press Win+Tab)
  2. Select (hover pointer over) the virtual desktop with Excel open in it.
  3. Right click or press and hold on the open Excel window and click on Show windows from this app on all desktops.

Windows 11:

  1. Click the Task View icon or press Win+Tab Task View icon
  2. Right click an Excel window.
  3. Select Show windows from this app on all desktops.

You must log in to answer this question.

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