Run command for Excel

by admin on February 11, 2012

We can open Excel application from Run by executing the command ‘excel

Run command for excel and excel command line options

However, ‘excel’ command does not work from command prompt. We need to use start to open excel application from command line.

start excel

To open a specific excel sheet from Run window you can use the below command.

excel fileName

Example: Open the data.xlsx file located in ‘Documents’ folder

excel c:\Users\loginid\Documents\data.xlsx

If the file has whitespace in the name, then we can use double quotes as below.

excel "C:\Users\loginid\Documents\File with spaces.xlsx"

Other command line options for Excel application

Command for opening an excel sheet in read-only mode

excel /r fileName

Command for launching excel without opening a new blank document.

excel /e

Change the ‘Save as’ folder foe excel files:

We can set a directory as the default location for saving excel files. Command for this is:

excel /p  directory

For example to set D:\docs as the ‘save as‘ directory, the command is:

excel /p  D:\docs

Launch excel in safe mode

excel /s

or

excel /safemode

All the above commands can be executed from command line by adding ‘start ‘ in the beginning of the command.

{ 3 comments… read them below or add one }

Pavan May 12, 2015 at 6:18 am

Why executing ‘excel’ from cmd does not work though it works from Run? I get the error ”excel’ is not recognized as an internal or external command,operable program or batch file’.

Reply

Martin May 12, 2015 at 8:32 pm

You must use excel.exe and not only excel

Reply

admin May 14, 2015 at 5:25 am

Even excel.exe generates the same error. Only Start excel works from cmd.

Leave a Comment

Previous post:

Next post: