Start Excel using the Command Prompt
As a user you get more control over the way you open Excel.
Excel command-line switches and parameters
These are the command switches available:
Switch and parameter
workbook path | file name
This parameter does not require a switch.
Description
Starts Excel and opens the specified file.
Example
excel.exe "c:\My Folder\book1.xlsx"
excel.exe http://MySite/Book1.xlsx
Switch and parameter
/r workbook path | file name
Description
Opens a specific workbook as read-only.
Example
excel.exe /r "c:\My Folder\book1.xlsx"
excel.exe /r http://MySite/Book1.xlsx
Switch and parameter
/t workbook path | file name
Description
Starts Excel and opens the specified file as a template.
Example
excel.exe /t "c:\My Folder\book_name.xlsx"
excel.exe /t http://MySite/book_name.xlsx
Switch and parameter
/n workbook path | file name
Description
Like /t, starts Excel and opens the specified file as a template.
Example
excel.exe /n "c:\My Folder\book_name.xlsx"
excel.exe /n http://MySite/book_name.xlsx
Switch and parameter
/e or /embed
Description
Prevents the Excel startup screen from appearing and a new blank workbook from opening.
Example
excel.exe /e
Switch and parameter
/p workbook path
Description
Specifies a folder as the active working folder (for example, the folder that is pointed to in the Save As dialog box).
Example
excel.exe /p “c:\My Folder”
Switch and parameter
/s or /safemode
Description
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
excel.exe /s
Switch and parameter
/m
Description
Creates a new workbook that contains a single XLM macro sheet.
Example
excel.exe /m
Switch and parameter
/a ProgID
Description
Starts Excel and loads the Automation add-in that is specified by the progID of the add-in.
Example
excel.exe /a MyProgId.MyProgID2.1
Switch and parameter
/x
Description
Starts a new instance (a separate process) of Excel.
Example
excel.exe /x “c:\My Folder\book1.xlsx”
excel.exe /x http://MySite/Book1.xlsx