文章编号: 291288 - 查看本文应用于的产品
展开全部 | 关闭全部

本文内容

概要

Microsoft Excel 接受数可用于控制如何在程序启动时的可选开关。本文列出了这些开关,并提供了每个开关说明。

更多信息

对于 Excel 2013 可选开关略有不同。若要了解有关它们的详细信息,请阅读:Excel 命令行开关

交换机

下表列出了可用于控制 Excel 启动方式的开关。开关不区分大小写: /O等同于/o。在某些情况下,可以一次使用多个开关。如果同时使用多个开关,则必须分隔与交换机空格,例如: /o /s
   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 <folder>      Forces Excel to use the path that you specify as the active
                    path instead of the default path. 

                    Example: /p "C:\Windows"

   /r <file name>    Forces Excel to open the specified file in
                    read-only mode.

                    Example: /r "C:\My Documents\Test.xls"

   /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 
                    <username>.xlb). You see "Safe Mode" in the 
                    Excel title bar. Use this switch when you want to 
                    start Excel in safe mode.

                    Example: /s or /safemode
				
   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 <folder>      Forces Excel to use the path that you specify as the active
                    path instead of the default path. 

                    Example: /p "C:\Windows"

   /r <file name>    Forces Excel to open the specified file in
                    read-only mode.

                    Example: /r "C:\My Documents\Test.xls"

   /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 
                    <username>.xlb). You see "Safe Mode" in the 
                    Excel title bar. Use this switch when you want to 
                    start Excel in safe mode.

                    Example: /s or /safemode
				   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 <folder>      Forces Excel to use the path that you specify as the active
                    path instead of the default path. 

                    Example: /p "C:\Windows"

   /r <file name>    Forces Excel to open the specified file in
                    read-only mode.

                    Example: /r "C:\My Documents\Test.xls"

   /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 
                    <username>.xlb). You see "Safe Mode" in the 
                    Excel title bar. Use this switch when you want to 
                    start Excel in safe mode.

                    Example: /s or /safemode
				   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 <folder>      Forces Excel to use the path that you specify as the active
                    path instead of the default path. 

                    Example: /p "C:\Windows"

   /r <file name>    Forces Excel to open the specified file in
                    read-only mode.

                    Example: /r "C:\My Documents\Test.xls"

   /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 
                    <username>.xlb). You see "Safe Mode" in the 
                    Excel title bar. Use this switch when you want to 
                    start Excel in safe mode.

                    Example: /s or /safemode
				   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 vali Excel 2003: HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Exceld,
                    they are not corrected by using this switch. This 
                    switch only replaces missing values.

                    Example: /o

   /p <folder>      Forces Excel to use the path that you specify as the active
                    path instead of the default path. 

                    Example: /p "C:\Windows"

   /r <file name>    Forces Excel to open the specified file in
                    read-only mode.

                    Example: /r "C:\My Documents\Test.xls"

   /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 
                    <username>.xlb). You see "Safe Mode" in the 
                    Excel title bar. Use this switch when you want to 
                    start Excel in safe mode.

                    Example: /s or /safemode
				
     /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.(Applies only to versions before Excel 2010)

                    Example: /regserver


   /unregserver     Forces Excel to unregister itself and then quit.(Applies only to versions before Excel 2010)

                    Example: /unregserver
				

如何使用开关在启动 Excel 时

如何将开关添加到 Microsoft Excel 快捷方式

将开关添加到 Microsoft Excel 快捷方式:
  1. 右键单击开始,单击打开,然后双击 程序 文件夹。
  2. 右键单击Microsoft excel的快捷方式,单击属性,然后单击快捷方式选项卡。
  3. 目标框中,键入您希望在运行该命令后的开关例如,如果希望 Excel 在启动时不创建新的 Excel.exe。工作簿,并且 Excel.exe 文件安装在默认位置,请键入在目标框中的以下内容:
    "C:\Program 主题 Office\Office\Excel.exe"/e
  4. 单击确定

    注意如果在属性对话框中的快捷方式选项卡上的选项不可用,您的快捷方式是窗口安装程序的快捷方式。有关如何修改这些快捷方式的详细信息,请单击下面的文章编号,以查看 Microsoft 知识库中相应的文章:
    290379Office 快捷方式选项卡不可用

要运行 Excel 时使用的命令开关一次一行的方式

如果想要偶尔使用某个开关运行 Excel,您可以添加在命令行开关。为此:
  1. 单击开始,然后单击运行
  2. 打开框中,键入 Excel.exe,路径,然后添加该开关,您要使用命令行的末尾。例如,如果您想要绕过启动文件夹中的所有文件,并且 Excel.exe 文件安装在默认位置,则键入下面的命令:
    "C:\Program 主题 Office\Office\Excel.exe"/s
  3. 单击确定

属性

文章编号: 291288 - 最后修改: 2013年3月15日 - 修订: 1.0
这篇文章中的信息适用于:
  • Microsoft Excel 2010
  • Microsoft Office Excel 2007
  • Microsoft Office Excel 2003
  • Microsoft Excel 2002 标准版
  • Microsoft Excel 2000 标准版
  • Microsoft Excel 97 标准版
关键字:?
kbinfo kbmt KB291288 KbMtzh
机器翻译
注意:这篇文章是由无人工介入的微软自动的机器翻译软件翻译完成。微软很高兴能同时提供给您由人工翻译的和由机器翻译的文章, 以使您能使用您的语言访问所有的知识库文章。然而由机器翻译的文章并不总是完美的。它可能存在词汇,语法或文法的问题,就像是一个外国人在说中文时总是可能犯这样的错误。虽然我们经常升级机器翻译软件以提高翻译质量,但是我们不保证机器翻译的正确度,也不对由于内容的误译或者客户对它的错误使用所引起的任何直接的, 或间接的可能的问题负责。
点击这里察看该文章的英文版: 291288
Microsoft和/或其各供应商对于为任何目的而在本服务器上发布的文件及有关图形所含信息的适用性,不作任何声明。 所有该等文件及有关图形均"依样"提供,而不带任何性质的保证。Microsoft和/或其各供应商特此声明,对所有与该等信息有关的保证和条件不负任何责任,该等保证和条件包括关于适销性、符合特定用途、所有权和非侵权的所有默示保证和条件。在任何情况下,在由于使用或运行本服务器上的信息所引起的或与该等使用或运行有关的诉讼中,Microsoft和/或其各供应商就因丧失使用、数据或利润所导致的任何特别的、间接的、衍生性的损害或任何因使用而丧失所导致的之损害、数据或利润不负任何责任。

提供反馈

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com