When you launch a Microsoft Office product, the startup process runs in a standard way. If you want to customize the process even more by loading an add-in or running a macro upon startup. You can add options like this by using subcommands called command-line switches to an Office app's startup command.
- If you want to use the customization just one time, you can type the command and switch in the Run dialog box (shortcut: Win+R) in Microsoft Windows.
- If you want to use a particular switch many times or every time that you start the app, you can create a desktop shortcut that starts the program by using the same switch and parameters.
Startup command names and locations
Here are the names of the startup commands for the Office products Word, Excel, PowerPoint, PowerPoint viewer, Outlook, and Access.
Office product | Command name |
---|---|
Word | winword.exe |
Excel | excel.exe |
PowerPoint | powerpnt.exe |
PowerPoint Viewer | pptview.exe |
Outlook | outlook.exe |
Access | msaccess.exe |
When you use one of the Office startup commands, you must supply the full path to the product's .exe file. Verify the location of this file on your computer. The following table shows the locations of the .exe files if you accepted the default folder locations during installation.
Office | Location |
---|---|
In Office 2007 | Windows 32-bit: C:\Program Files (x86)\Microsoft Office\Office12\
Windows 64-bit: |
In Office 2010 | Windows 32-bit: C:\Program Files (x86)\Microsoft Office\Office14\
Windows 64-bit: |
In Office 2013 | Windows 32-bit: C:\Program Files (x86)\Microsoft Office\Office15\
Windows 64-bit: |
In Office 2016 & Office 2019 |
Windows 32-bit: C:\Program Files (x86)\Microsoft Office\Office16\
Windows 64-bit: |
In Office 365 | Windows 32-bit: C:\Program Files (x86)\Microsoft Office\root\Office16\
Windows 64-bit: |
The command-line switches rules
- You can use only one switch at a time. Starting an Office app with multiple switches is not supported.
- If the parameter is a path to a location on your computer, or a file name with spaces in it, enclose it in double quotation marks, for example,
/t "Monthly Report.dotx"
. - Switches and parameters are not case-sensitive. For example, /RO functions the same as /ro.
- Include one blank space before each switch and one before each parameter.
Make a switch available for reuse by creating a shortcut
- Right-click the Windows desktop, point to New, and then click Shortcut on the shortcut menu.
- In the Create Shortcut Wizard, in the Type the location of the item box, type a double quotation mark (
"
), enter the full path for the app's .exe file (including the file name), and then type another double quotation mark. (Alternatively, click Browse to locate and select the file. In this case, the quotation marks are added automatically.) - Following the closing quotation mark, type a space, and then type the switch and any parameters. If the parameter is a path to a location on your computer, and the path contains a space, it also must be enclosed in quotation marks. For example:
"C:\Program Files\Microsoft Office\Office16\excel.exe" /r "D:\My Folder\book1.xlsx"
- Click Next.
- In the Type a name for this shortcut box, type a name for the shortcut, and then click Finish. The wizard creates the shortcut and places it on the desktop.
Whenever you want to use the shortcut to start the app, double-click it.
To add the desktop shortcut to the Windows Start menu, right-click the shortcut, and then click Pin to Start on the shortcut menu.
List of command-line switches for Excel
Switch and parameter | Description |
---|---|
workbook path | file name
This parameter does not require a switch. |
Starts Excel and opens the specified file.
Example
or
|
/r workbook path | file name | Opens a specific workbook as read-only.
Example
or
|
/t workbook path | file name | Starts Excel and opens the specified file as a template.
Example
or
|
/n workbook path | file name | Like /t, starts Excel and opens the specified file as a template.
Example
or
|
/e or /embed | Prevents the Excel startup screen from appearing and a new blank workbook from opening.
Example
|
/p workbook path | Specifies a folder as the active working folder (for example, the folder that is pointed to in the Save As dialog box).
Example
|
/s or /safemode | Forces Excel to bypass all files that are stored in startup directories, such as the default XLStart folder located in the directory where Excel or Microsoft Office is installed.
Example
|
/m | Creates a new workbook that contains a single XLM macro sheet.
Example
|
/a progID | Starts Excel and loads the Automation add-in that is specified by the progID of the add-in.
Example
|
/x | Starts a new instance (a separate process) of Excel.
Example
or
|