`
hcmfys
  • 浏览: 364193 次
  • 性别: Icon_minigender_1
  • 来自: 广州
社区版块
存档分类
最新评论

How to configure Office applications to run under the interactive user account

    博客分类:
  • c#
阅读更多
We do not recommend or support Automation to a Microsoft Office application from an unattended user account. For more information about why we do not recommend Automation in this context, click the following article number to view the article in the Microsoft Knowledge Base:
257757  (http://support.microsoft.com/kb/257757/ ) Considerations for server-side Automation of Office
If there is no choice but to automate Office from an unattended user account, use the steps in this article to configure the computer to run the Office application as the interactive user.
Back to the top
MORE INFORMATION
Caution Automation of any Office application from an unattended, non-interactive...
Caution Automation of any Office application from an unattended, non-interactive user account is risky and unstable. A single error in code or configuration can result in a dialog box that can cause the client process to stop responding (hang), that can corrupt data, or that can even crash the calling process (which can bring down your Web server if the client is ASP).

Warning Office was not designed, and is not safe, for unattended execution on a server. Developers who use Office in this manner do so at their own risk.

Regardless, it may absolutely required to use Office in this manner. In these cases, special configuration must be done to avoid errors on Office startup. The steps in this article demonstrate how to configure Office to run as the interactive user account when it is started for Automation.

When you automate under the interactive user account, you should be aware of the following problems:

    * Normally, the Interactive User is defined as the the user that is logged on to the local console (that is, the user who is physically at the computer). On computers that use Microsoft Windows 2000 Terminal Services or Microsoft Windows XP Terminal Services, the Interactive User is defined as a user who is logged on to the local console or a user who is connected to the computer through a remote Terminal Server client.
    * When it is started through automation, the Office application always runs under the security context of the user that is doing the automation. If the user is logged on to the server locally, the application runs under that user context. If a user is connected through a Terminal Server session, the application runs under that user account.

      Note If you have multiple Terminal Server connections, the application runs under the context of each user who is logged on.
    * When the Office application is started from a user context that does not have interactive privileges (such as the SYSTEM account), a user must be logged on to the server at the local console, regardless of whether Terminal Services is being used, otherwise an error occurs and the application does not start.

The following table shows some scenarios you may experience when an Office application is configured to run as the Interactive User:
Collapse this tableExpand this table
Programming action Logged on at local console? Results
Programmatically create an instance of the application from a user session logged on the machine remotely through a Terminal Server Client Yes Success: The application starts under the desktop of the local or remote user that is running the Automation code.
No Success: The application starts under the desktop of the remote user that is running the Automation code.
Programmatically create an instance of the application from an account with a non-interactive SID (ASP, Service, etc.) Yes Success: The application starts under the desktop of the user that is logged on locally (the user that is physically at the machine).
No Error: 0x8000401A - CO_E_RUNAS_LOGON_FAILURE The server process could not be started because the configured identity is incorrect. Check the username and password.
Programmatically create an instance of the application from an MTS/COM+ package that is configured to run as INTERACTIVE Yes Success: The application starts under the desktop of the user that is logged on locally. Terminal Server sessions are not "interactive" in this case.
No Error: 0x8000401A - CO_E_RUNAS_LOGON_FAILURE The server process could not be started because the configured identity is incorrect. Check the username and password.
Programmatically create an instance of the application from an MTS/COM+ package that is configured to run as a specific user Yes Success: The application starts under the desktop of the user that is logged on locally, and not the specific user account for the package.
No Error: 0x8000401A - CO_E_RUNAS_LOGON_FAILURE The server process could not be started because the configured identity is incorrect. Check the username and password.
Because the changes in DCOM are global, configuring Office in this manner can have negative side effects for other clients on the system that use Office. It is possible that another client application will not be able to use the Office application after the settings are made. Consider carefully what impact this has to your server before you make any changes to the DCOM configuration settings.

If the problems listed here are too great for your design, or cause other unidentified problems, it is possible to configure Office differently and still allow it to start from an unattended process or service. For more information, click the following article numbers to view the articles in the Microsoft Knowledge Base:
288367  (http://support.microsoft.com/kb/288367/ ) How to configure Office applications to run under a specific user account
288368  (http://support.microsoft.com/kb/288368/ ) How to configure Office applications for automation from a COM+/MTS package
Configuring Office as the interactive user
To set up an Office Automation server under the interactive user account, follow these steps:

   1. Log on to the computer as the Administrator and install (or reinstall) Office using a complete install. For system robustness, it is recommended that you copy the contents of the Office CD-ROM to a local drive and install Office from this location.
   2. Start the Office application that you intend to automate. This forces the application to register itself.
   3. After the application is running, press ALT+F11 to load the Microsoft Visual Basic for Applications (VBA) editor. This forces VBA to initialize itself.
   4. Close the applications, including VBA.
   5. Click Start, click Run, and then type DCOMCNFG. Select the application that you want to automate. The application names are listed in the following table.
      Collapse this tableExpand this table
      Office program Application name
      Microsoft Access 97 Microsoft Access Database
      Microsoft Access 2000/2002 Microsoft Access Application
      Microsoft Office Access 2003 Microsoft Access Application
      Microsoft Office Access 2007 Microsoft Office Access Application
      Microsoft Excel 97/2000/2002 Microsoft Excel Application
      Microsoft Office Excel 2003 Microsoft Excel Application
      Microsoft Office Excel 2007 Microsoft Excel Application
      Microsoft Word 97 Microsoft Word Basic
      Microsoft Word 2000/2002 Microsoft Word Document
      Microsoft Office Word 2003 Microsoft Word Document
      Microsoft Office Word 2007 Microsoft Office Word 97 - 2003 Document
      Click Properties to open the property dialog box for this application.
   6. Click the Security tab. Verify that Use Default Access Permissions and Use Default Launch Permissions are selected.
   7. Click the Identity tab and then select The Interactive User.
   8. Click OK to close the property dialog box and return to the main applications list dialog box.
   9. In the DCOM Configuration dialog box, click the Default Security tab.
  10. Click Edit Defaults for access permissions. Verify that the following users are listed in the access permissions, or add the users if they are not listed:
          * SYSTEM
          * INTERACTIVE
          * Everyone
          * Administrators
          * IUSR_machinename (See note)
          * IWAM_machinename (See note)
      Note These accounts only exist if Internet Information Server (IIS) is installed on the computer.
  11. Make sure that each user is allowed access and click OK.
  12. Click Edit Defaults for launch permissions. Verify that the following users are listed in the launch permissions, or add the users if they are not listed:
          * INTERACTIVE
          * Everyone
          * Administrators
          * IUSR_machinename (See note)
          * IWAM_machinename (See note)
      Note These accounts exist only if IIS is installed on the computer.
  13. Make sure that each user is allowed access, and then click OK.
  14. Click OK to close DCOMCNFG.
  15. Start Registry editor and verify that the following keys and string values exist for the Office application that you want to automate:
      Microsoft Office Access 2003/2007:
      Key: HKEY_CLASSES_ROOT\AppID\MSACCESS.EXE
      AppID: {73A4C9C1-D68D-11D0-98BF-00A0C90DC8D9}

      Microsoft Access 2000/2002:
      Key: HKEY_CLASSES_ROOT\AppID\MSACCESS.EXE
      AppID: {73A4C9C1-D68D-11D0-98BF-00A0C90DC8D9}

      Microsoft Access 97:
      Key: HKEY_CLASSES_ROOT\AppID\MSACCESS.EXE
      AppID: {8CC49940-3146-11CF-97A1-00AA00424A9F}

      Microsoft Office Excel 2003/2007:
      Key: HKEY_CLASSES_ROOT\AppID\EXCEL.EXE
      AppID: {00020830-0000-0000-C000-000000000046}

      Microsoft Excel 97/2000/2002:
      Key: HKEY_CLASSES_ROOT\AppID\EXCEL.EXE
      AppID: {00020812-0000-0000-C000-000000000046}

      Microsoft Office Word 2003/2007:
      Key: HKEY_CLASSES_ROOT\AppID\WINWORD.EXE
      AppID: {C184E717-402A-438F-B99E-77C2CD4091C8}

      Microsoft Word 97/2000/2002:
      Key: HKEY_CLASSES_ROOT\AppID\WINWORD.EXE
      AppID: {00020906-0000-0000-C000-000000000046}
      If these keys do not exist, you can create them by running a .reg file on your computer that resembles the following .reg file:

      REGEDIT4

      [HKEY_CLASSES_ROOT\AppID\WINWORD.EXE]
      "AppID"="{00020906-0000-0000-C000-000000000046}"

      [HKEY_CLASSES_ROOT\AppID\EXCEL.EXE]
      "AppID"="{00020812-0000-0000-C000-000000000046}"

      [HKEY_CLASSES_ROOT\AppID\MSACCESS.EXE]
      "AppID"="{73A4C9C1-D68D-11D0-98BF-00A0C90DC8D9}"
     

      Note The sample .reg file is for Access 2000 or Access 2002. If you are using Access 97, change the AppID key to:

      "AppID"="{8CC49940-3146-11CF-97A1-00AA00424A9F}"

  16. Restart the system. This is required.

Back to the top
REFERENCES
For more information, click the following article numbers to view the articles...
For more information, click the following article numbers to view the articles in the Microsoft Knowledge Base:
169321  (http://support.microsoft.com/kb/169321/ ) COM servers activation and NT Windows stations
184291  (http://support.microsoft.com/kb/184291/ ) COM objects fail to print when called from ASP
Back to the top
APPLIES TO

    * Microsoft Office Access 2007
    * Microsoft Office Access 2003
    * Microsoft Access 2002 Standard Edition
    * Microsoft Access 2000 Standard Edition
    * Microsoft Access 97 Standard Edition
    * Microsoft Office Excel 2007
    * Microsoft Office Excel 2003
    * Microsoft Excel 2002 Standard Edition
    * Microsoft Excel 2000 Standard Edition
    * Microsoft Excel 97 Standard Edition
    * Microsoft Office Word 2007
    * Microsoft Word 2002
    * Microsoft Word 2000
    * Microsoft Word 97 Standard Edition
分享到:
评论

相关推荐

    flex on rails

    For efficient development, the book explains how to configure Flex Builder to run and debug the application, streamlining the development process. #### Summary In summary, "Flex on Rails" is a ...

    cmd-bat-批处理-脚本-Screenshot.zip

    cmd-bat-批处理-脚本-Screenshot.zip

    升\降压电路的自计算表格 及 公式表达

    公式主要来自于德州仪器的datasheet 以及 一些电路公式表达式

    2025年自动检测生产线项目大数据研究报告.docx

    2025年自动检测生产线项目大数据研究报告.docx

    cmd-bat-批处理-脚本-deactivate.zip

    cmd-bat-批处理-脚本-deactivate.zip

    cmd-bat-批处理-脚本-happy05 1.zip

    cmd-bat-批处理-脚本-happy05 1.zip

    基于MATLAB的单相光伏并网逆变器仿真研究

    在单相光伏逆变器相关领域,涉及诸多关键环节。首先,光伏系统建模是基础,其中光伏板作为能量来源,其特性建模至关重要。最大功率点跟踪(MPPT)技术用于确保光伏板输出功率最大化,而Boost升压电路则负责将光伏板输出的较低电压提升至适合逆变器处理的水平。在控制策略方面,电压电流双闭环控制是实现稳定输出的关键,通过精确控制电压和电流,保证逆变器的性能。最终目标是使并网电流波形达到标准正弦波形,以满足电网接入要求。希望与大家深入交流这些内容,共同探讨技术细节与优化方案。

    cmd-bat-批处理-脚本-JoinDomain.zip

    cmd-bat-批处理-脚本-JoinDomain.zip

    cmd-bat-批处理-脚本-ppcp.zip

    cmd-bat-批处理-脚本-ppcp.zip

    最新修复版走路赚钱乐步2.0任务平台系统源码

    内附详细安装教程,亲测搭建无问题。 一、乐步交易流程----购买乐步糖果 方法一:在卖方市场选择合适的卖家或者用手机号定向查询特定卖家 步骤一:点击首页下方【交易中心】。 步骤二:点击【卖单列表】,选择合适的卖家或者用手机号搜索特定卖家,确定卖家之后点击该卖家后方的【购买】。 步骤三:点击之后,系统会显示该卖家的收款信息。按照系统显示的收款信息付款,(付款备注交易订单号)付款完成之后上传凭证,等待卖家确认收款并且支付糖果。 方法二:挂单买入糖果 步骤一:点击首页下方【交易中心】。 步骤二:点击【买单列表】--【发布买单】,填写购买糖果单价、数量、交易密码,点击【确定】,买单发布,等待匹配成交。 二、乐步交易流程----出售乐步糖果 方法一:在买方市场选择合适的买家或者用手机号定向查询特定买家 步骤一:点击首页下方【交易中心】。 步骤二:点击【买单列表】,选择合适的买家或者用手机号搜索特定买家,确定买家之后点击该买家后方的【出售】。 步骤三:点击之后,系统会提示买家付款,买家按照系统提示的账号给卖家付款(付款备注交易订单号),付款完成之后上传凭证,等待卖家确定并且支付糖果。 方法二:挂单卖出糖果 步骤一:点击首页下方【交易中心】。 步骤二:点击【卖单列表】--【发布卖单】,填写出售糖果单价、数量、验证码、交易密码,点击【确定】,卖单发布,等待匹配成交。

    多媒体技术及应用实验三(音视频编码转换软件开发)

    包括一个python源程序和一个.exe文件

    永磁同步电机速度环控制中的多种PID自整定技术及其应用 RBF神经网络

    内容概要:本文探讨了永磁同步电机(PMSM)速度环控制中多种PID自整定技术的应用,包括RBF神经网络PID、基于分解合并机制的RBF神经网络PID、基于小波神经网络的PID、粒子群算法优化PID、天牛须算法优化PID以及模糊PID自整定。每种技术都通过具体的数学模型和代码片段进行了详细的解释,旨在提升PMSM速度环控制的精度和效率。 适合人群:从事电机控制系统研究和开发的技术人员,尤其是对PID自整定技术和智能算法感兴趣的工程师。 使用场景及目标:适用于需要改进现有PMSM速度环控制系统的场合,目标是通过引入先进的PID自整定技术,提高系统的响应速度、稳定性和鲁棒性。 其他说明:文中不仅介绍了各种技术的基本原理,还提供了部分Python代码示例,帮助读者更好地理解和实践这些方法。同时,强调了不同技术之间的对比和优势,便于读者根据实际情况选择最合适的技术路径。

    桔子云测评小程序V1.1.1+前端.zip

    桔子云测评小程序,做专业测评系统小程序平台,支持微信小程序和抖音小程序,为网友提供心理测试,帮助你更好地了解自己的兴趣、性格、能力等特点,找到适合自己的成长之路。 盈利模式 流量主、激励视频解锁、单独付费测评、VIP会员付费等 功能特色 1、支持定义3种题型:单题型、多题型、 有因子多题型 2、 因子题型支持算法自定义分析 3、答案支持单独自定义分享海报 4、IOS端可设置联系客服索取激活码付费方式 5、支持量表导入 6、支持跳转其他小程序 7、支持分销推广 版本号:1.1.1 – 多开商业版 【修复】添加项目出现分类串联问题 【修复】快速测试出现结果错误问题 【优化】重新测试体验流程 toutiao前端、微信前端都需要提交审核

    2025年职称计算机考试题型及大纲.doc

    2025年职称计算机考试题型及大纲.doc

    cmd-bat-批处理-脚本-TV no signal color bars.zip

    cmd-bat-批处理-脚本-TV no signal color bars.zip

    实证数据-2009-2023上市公司-绿色治理绩效数据-社科经管.rar

    该数据集为2009-2023年中国上市公司绿色治理绩效(GGP)面板数据,覆盖1557家上市公司,数据来源于华证ESG评级、上市公司年报及社会责任报告等公开披露信息。核心指标包括污染物排放达标/未达标得分、突发环境事故、环境违法事件、ISO14001认证情况等12项环境治理指标,采用Janis-Fadner系数法计算综合绩效值(GGP),反映企业在环境合规、绿色运营及社会责任履行等方面的表现。数据经学术团队整理校验,参考《管理世界》等期刊的测度方法,可直接用于ESG表现、绿色创新等领域的实证研究。部分样本包含财务指标匹配数据,便于多维度分析。

    基于GJO-TCN-BiGRU-Attention的Matlab多变量时间序列预测算法及应用 BiGRU Matlab源码与数据集:GJO-TCN-BiGRU-Attention金豹算法优化多变量时间

    内容概要:本文介绍了利用Matlab实现的基于GJO-TCN-BiGRU-Attention算法的时间序列预测方法。该方法结合了时间卷积网络(TCN)、双向门控循环单元(BiGRU)以及注意力机制,用于多变量时间序列预测。文中详细描述了模型架构的设计思路及其各部分的功能,如TCN层用于捕捉长期依赖关系,BiGRU处理双向时序特征,而注意力层则赋予不同特征不同的权重。此外,还探讨了参数优化的方法——采用金豹优化(GJO)算法调整学习率、神经元数目、注意力机制的关键参数等超参数,并提供了完整的源代码和数据集。实验结果显示,该模型在电力负荷预测任务中表现出色,相比单一模型提升了大约8个百分点。 适用人群:对时间序列预测感兴趣的科研工作者、研究生及以上水平的数据科学家和技术爱好者。 使用场景及目标:适用于需要进行高精度多变量时间序列预测的应用场合,比如能源管理系统的负荷预测、金融市场趋势分析等领域。目标是提高预测准确性,降低误差。 其他说明:文中提到一些实践经验,例如避免TCN层数过多导致梯度爆炸的问题,推荐使用RobustScaler进行数据标准化处理,以及选择合适的序列滑窗长度等技巧。

    二十四节气之立秋节气介绍.pptx

    二十四节气之立秋节气介绍.pptx

    cmd-bat-批处理-脚本-FAA Program.zip

    cmd-bat-批处理-脚本-FAA Program.zip

    cmd-bat-批处理-脚本-lookup.zip

    cmd-bat-批处理-脚本-lookup.zip

Global site tag (gtag.js) - Google Analytics