2

I can't find a proper *.exe for Excel in the usual places:

  • "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft Office
  • "c:\program files\microsoft office\office12\excel.exe"

Does anybody know where I would find the Excel executable for a Windows Vista machine? For that matter, also invoke Excel to open an existing *.xls file using a batch file?

Incidentally, the Shortcut for Excel shows "target:" to be

Microsoft Office Professional Hybrid 2007

1
  • If your Windows install is 64-bit then Excel.exe will be in "<drive>:\Program Files (x86)\" May 6, 2011 at 16:56

3 Answers 3

2

Just add this line to your batch file:

  • START "name of spreadsheet.xls"

This will use the default file association to open the file. If you need a specific version though, then you'll need to find the appropriate .EXE file which might be under a sub-directory called "Common" or "Common files" which should be somewhere under "C:/Program Files/" or "C:/Program Files (x86)/" (stuff is often scattered between both of these as applications are slowly transitioning from 32-bit to 64-bit).

Depending on the default file assocation will ensure that your batch file is portable, so you should prefer to use this approach if you can.

2
  • 1
    Note that if your file name needs quotes due to spaces or shell metacharacters, you'll need an empty set of quotes first: start "" "file name with spaces.xls"
    – Joey
    May 11, 2011 at 10:02
  • I note that invoking Microsoft Word occurs with the following string on my Vista 64-bit machine: "C:\Program Files (x86)\Microsoft Office\Office12\winword.exe"
    – Rolnik
    May 11, 2011 at 15:13
3

If you want to start excel on its own, you can use.

  Start Excel

You should be able to find the exact path by opening a command prompt and typing

 reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\excel.exe"
1
  • This seems like a really good solution to me, which certainly also is in keeping with the spirit of being portable (although it may only be limited to use in Microsoft Windows, WINE, and possibly ReactOS.org since the Windows Registry is specific to a Microsoft environment). May 12, 2011 at 1:21
0

I just stumbled across this amazingly clear Microsoft Support article: Command-line switches for Microsoft Office products It lists executable names and paths for Office 2007, 2010, 2013, and 2016 products in its Startup command names and locations section .

I notice that the version of Windows 7/Office that I'm using now does list the target path in the shortcut, but I have run across this problem in the past.

Edit: I also discovered that this is because of .NET Advertised Shortcuts. This Stack Overflow question gives a bit more info.

You must log in to answer this question.

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