You can open Microsoft Excel from the command prompt and you can also add additional parameters to the command to do things like open Excel with a specific template or start Excel in safe mode to fix problems.
Start Excel using command prompt
There are many alternatives to start Excel using command prompt, but if you want to start excel in its normal state (In other words, the same way Excel starts when you click the shortcut), there are two different ways to do it.
First, there's the simple way. Open the command prompt by typing “cmd” in the Windows search bar and click the command prompt application in the search results.
The command prompt will open. To start Excel, type this command and then press enter:
start excel
excel should start immediately.
Another way to open Excel is by locating the directory that contains the excel file.exe, changing to that directory at the command prompt and then running a simple command.
To locate the excel file.exe, it should be in the program files directory at the command prompt. You can use the cd
command to change the directory. type this command at the command prompt and then press enter:
cd"program files"
you will now be in the program files directory. Next, you need to find out which directory the excel file is in.exe. To do it, run this command:
dir excel.exe /s
The excel file directory will be returned.exe.
Now that you know the directory where excel is located.exe, navigate to that directory. As we are already in the Program Files directory, we can omit it in the following command. In our example, we would run this command:
cd Microsoft OfficerootOffice16
Now that you are in the correct directory, all that remains to be done is to write excel
at the command prompt and press Enter.
Excel will now open. Despite this, The main purpose of starting Excel from the command prompt is that you can control excuse me it opens, and it does so by adding the multiple switches and parameters that are available to the command.
Excel command line switches and parameters
Here is a list of command switches provided by the Microsoft Office official support site. Add them to the end of the start excel
command at the command prompt.
Switch and parameter | Description |
workbook path | file name No switch needed. |
Open the destination file. Example: start Excel “c: sample folder nombre_archivo1.xlsx” O start excel http: //MySite/file_name1.xlsx |
/ r workbook path | file name |
Open the target workbook as read-only. Example: start excel / r “c: sample folder nombre_archivo1.xlsx” O start excel / r http: //MySite/file_name1.xlsx |
/ t workbook path | file name
You can also use /North instead of / t to achieve the same result. |
Open the target file as a template.
Example: start excel / t “c: sample folder nombre_archivo1.xlsx” O start Excel / t http: //MySite/file_name1.xlsx |
/me O /embed | Prevent the Excel startup screen from appearing and a new blank workbook from opening. |
/s O /Safe Mode | Start Excel in safe mode. This starts Excel without add-ins, templates or other additional customizations. It is useful to fix problems in Excel. |
/metro | Create a new workbook containing a single XLM macro sheet. |
/a progID | Loads the automation plugin specified by the plugin progID.
Example: start Excel / a MyProgId.MyProgID2.1 |
/X | Starts a separate Excel procedure. |
With these commands, you can open Excel in several different ways.
Excel is not the only Office program that you can open with the command prompt; you can also use it to start Microsoft Word and PowerPoint. Commands may differ between applications, so explore what options are available for each.