Excel Start-up/Command-line Switches

  • <h3><b>Original Source:</b> <a target="_blank" href="http://support.microsoft.com/kb/291288">Description of the startup switches for Excel</a></h3><h3>SUMMARY</h3><p class="j">Microsoft Excel accepts a number of optional switches that you can use to control how the program starts. This article lists the switches and provides a description of each switch.</p><table cellspacing="0" cellpadding="0" style="line-height: 200%" width="80%"><tr><td><h3>Switches</h3>The following table lists the switches that you can use to control how Excel starts. Switches are not case sensitive: <b>/O</b> is the same as <b>/o</b>. In some scenarios, you can use more than one switch at a time. If you use more than one switch at a time, you must separate the switches with spaces -- for example: <b>/o /s</b> <div><div>
    <pre> Switch Function
    ----------------------------------------------------------------------


    /e, /embedded Forces Excel to start without displaying the
    startup screen and creating a new workbook
    (Book1.xls).


    Example: /e or /embedded


    /m Forces Excel to create a new workbook that
    contains a single macro sheet.


    Example: /m


    /o Forces Excel to re-register itself. Specifically,
    the following key is rewritten in the registry:


    Excel 97: HKEY_CURRENT_USER\Software\Microsoft\Office\8.0\Excel

    Excel 2000: HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Excel


    Excel 2002: HKEY_CURRENT_USER\Software\Microsoft\Office\10.0\Excel


    Excel 2003: HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Excel


    NOTE: If this key contains values that are not valid,
    they are not corrected by using this switch. This
    switch only replaces missing values.


    Example: /o


    /p &lt;folder&gt; Forces Excel to use the path that you specify as the active
    path instead of the default path.


    Example: /p &quot;C:\Windows&quot;


    /r &lt;file name&gt; Forces Excel to open the specified file in
    read-only mode.


    Example: /r &quot;C:\My Documents\Test.xls&quot;


    /s, /safemode Forces Excel to bypass all files in the Application Data\Microsoft\Xlstart folder,
    the default XLStart folder located in the directory where Excel or Office is installed,
    and the alternate startup file location specified on the General tab of the Excel Options dialog box.
    It also forces Excel
    to bypass the toolbar file (Excel.xlb or
    &lt;username&gt;.xlb). You see &quot;Safe Mode&quot; in the
    Excel title bar. Use this switch when you want to
    start Excel in safe mode.


    Example: /s or /safemode
    </pre></div></div><div><div>
    <pre> /t Forces Excel to use the specified file as a
    template for the default workbook.


    /regserver Forces Excel to register itself and then quit. Use this
    switch when you want Excel to rewrite all its
    registry keys and reassociate itself with Excel files,
    such as workbooks, charts, and others.


    Example: /regserver



    /unregserver Forces Excel to unregister itself and then quit.


    Example: /unregserver
    </pre></div></div><h4>How to Add a Switch to the Microsoft Excel Shortcut</h4>To add a switch to the Microsoft Excel shortcut: <ol><li>Right-click <b>Start</b>, click <b>Open</b>, and then double-click the <strong class="uiterm">Programs</strong> folder. </li><li>Right-click the shortcut for <b>Microsoft Excel</b>, click <b>Properties</b>, and then click the <b>Shortcut</b> tab. </li><li>In the <b>Target</b> box, type the switches that you want after the command that runs Excel.exe. For example, if you want Excel to start without creating a new workbook, and the Excel.exe file is installed in the default location, type the following in the <b>Target</b> box: <div>&quot;C:\Program Files\Microsoft Office\Office\Excel.exe&quot; /e</div></li><li>Click <b>OK</b>.<br><br><b>Note</b> If the options on the <b>Shortcut</b> tab in the <b>Properties</b> dialog box are not available, your shortcuts are Windows Installer shortcuts. For more information about how to modify these shortcuts, click the following article number to view the article in the Microsoft Knowledge Base: <div><a href="http://support.microsoft.com/kb/290379/">290379</a>&nbsp; (http://support.microsoft.com/kb/290379/ ) Office Shortcut tab is unavailable </div></li></ol><h4>How to Run Excel One Time with a Switch by Using the Command Line</h4>If you want to run Excel with a switch occasionally, you can add the switch to the command line. To do this: <ol><li>Click <b>Start</b>, and then click <b>Run</b>. </li><li>In the <b>Open</b> box, type the path to Excel.exe, and then add the switch that you want to use at the end of the command line. For example, if you want to bypass all the files in the startup folders and the Excel.exe file is installed in the default location, you type the following command: <div>&quot;C:\Program Files\Microsoft Office\Office\Excel.exe&quot; /s</div></li><li>Click <b>OK</b>.</li></ol></td></tr></table><h3><b>Original Source:</b> <a target="_blank" href="http://support.microsoft.com/kb/291288">Description of the startup switches for Excel</a></h3>