`
hcmfys
  • 浏览: 363590 次
  • 性别: 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 ...

    深度强化学习:DDPG、TD3、SAC与机器人MuJoCo

    内容概要:本文详细介绍了三种主流的深度强化学习算法-DDPG、TD3和SAC在机器人控制领域的应用,特别是在MuJoCo仿真环境中的实现细节。首先解释了每个算法的基本原理及其独特之处,如DDPG的确定性策略生成器、TD3的双Critic网络以及SAC的熵最大化机制。接着深入探讨了这些算法的具体代码实现,包括Actor和Critic网络的设计、损失函数的构建以及一些实用的调参技巧。此外,还分享了许多实战经验和常见陷阱,如正确处理done信号、添加动作变化量惩罚项、观测空间的归一化等。 适合人群:对深度强化学习有一定了解并希望深入了解其在机器人控制领域应用的研究人员和技术爱好者。 使用场景及目标:帮助读者掌握如何将DDPG、TD3和SAC应用于具体的机器人控制任务中,提高算法性能,解决实际问题。同时,也为进一步研究提供了宝贵的实践经验。 其他说明:文中不仅提供了详细的理论讲解,还附带了大量的代码片段,便于读者理解和实践。对于想要深入理解这些算法内部运作机制的人来说,是一份不可多得的学习资料。

    基于QEM的优化网格简化算法C和C++实现源码(含论文).zip

    【资源说明】 1.项目代码功能经验证ok,确保稳定可靠运行。欢迎下载使用!在使用过程中,如有问题或建议,请及时私信沟通。 2.主要针对各个计算机相关专业,包括计科、信息安全、数据科学与大数据技术、人工智能、通信、物联网等领域的在校学生、专业教师或企业员工使用。 3.项目具有丰富的拓展空间,不仅可作为入门进阶,也可直接作为毕设、课程设计、大作业、初期项目立项演示等用途。 4.当然也鼓励大家基于此进行二次开发。 5.期待你能在项目中找到乐趣和灵感,也欢迎你的分享和反馈! 本文介绍了基于QEM(Quadric Error Metrics,二次误差度量)的优化网格简化算法的C和C++实现源码及其相关文档。这一算法主要应用于计算机图形学领域,用于优化三维模型的多边形数量,使之在保持原有模型特征的前提下实现简化。简化的目的是为了提高渲染速度,减少计算资源消耗,以及便于网络传输等。 本项目的核心是网格简化算法的实现,而QEM作为该算法的核心,是一种衡量简化误差的数学方法。通过计算每个顶点的二次误差矩阵来评估简化操作的误差,并以此来指导网格简化过程。QEM算法因其高效性和准确性在计算机图形学中广泛应用,尤其在实时渲染和三维打印领域。 项目代码包含C和C++两种语言版本,这意味着它可以在多种开发环境中运行,增加了其适用范围。对于计算机相关专业的学生、教师和行业从业者来说,这个项目提供了丰富的学习和实践机会。无论是作为学习编程的入门材料,还是作为深入研究计算机图形学的项目,该项目都具有实用价值。 此外,项目包含的论文文档为理解网格简化算法提供了理论基础。论文详细介绍了QEM算法的原理、实施步骤以及与其他算法的对比分析。这不仅有助于加深对算法的理解,也为那些希望将算法应用于自己研究领域的人员提供了参考资料。 资源说明文档强调了项目的稳定性和可靠性,并鼓励用户在使用过程中提出问题或建议,以便不断地优化和完善项目。文档还提醒用户注意查看,以获取使用该项目的所有必要信息。 项目的文件名称列表中包含了加水印的论文文档、资源说明文件和实际的项目代码目录,后者位于名为Mesh-Simplification-master的目录下。用户可以将这些资源用于多种教学和研究目的,包括课程设计、毕业设计、项目立项演示等。 这个项目是一个宝贵的资源,它不仅提供了一个成熟的技术实现,而且为进一步的研究和学习提供了坚实的基础。它鼓励用户探索和扩展,以期在计算机图形学领域中取得更深入的研究成果。

    IEEE 6 bus节点系统仿真:Matlab/Simulink质量保证的自主搭建模型,电压稳定且与标准参数一致的可观测电压

    内容概要:本文详细介绍了如何使用Matlab/Simulink搭建IEEE 6节点电力系统仿真模型,确保电压稳定并与标准参数一致。主要内容涵盖节点与线路搭建、负载设置、电压稳定控制以及电压观测方法。文中强调了通过自动电压调节器(AVR)模块保持电压稳定,并通过电压测量模块实现电压观测。此外,还讨论了模型验证和优化技巧,如故障仿真、负荷模型设置和数据可视化。 适合人群:从事电力系统研究和技术开发的专业人士,尤其是有一定Matlab/Simulink基础的工程师和研究人员。 使用场景及目标:适用于电力系统仿真、电压稳定性分析、故障响应测试等应用场景。目标是帮助用户掌握电力系统建模的基本步骤和关键技术,提高仿真模型的可靠性和准确性。 其他说明:文中提供了详细的代码示例和配置指南,有助于读者快速理解和应用。同时,作者分享了许多实践经验,如参数设置、故障排除和性能优化,使模型更加贴近实际工程需求。

    少儿编程scratch项目源代码文件案例素材-掉箱子.zip

    少儿编程scratch项目源代码文件案例素材-掉箱子.zip

    Apk包名信息提取(支持图标)

    Apk包名信息提取(支持图标)

    少儿编程scratch项目源代码文件案例素材-回放.zip

    少儿编程scratch项目源代码文件案例素材-回放.zip

    基于改进粒子群算法的混合储能系统容量优化程序

    内容概要:本文详细介绍了利用改进粒子群算法(PSO)进行混合储能系统(如电池与超级电容组合)容量优化的方法。文中首先指出了传统PSO易陷入局部最优的问题,并提出通过非线性衰减惯性权重、引入混沌因子和突变操作等方法来改进算法性能。随后,作者展示了具体的Python代码实现,包括粒子更新策略、适应度函数设计以及边界处理等方面的内容。适应度函数不仅考虑了设备的成本,还加入了对设备寿命和功率调节失败率的考量,确保优化结果的实际可行性。实验结果显示,在风光发电系统的应用场景中,改进后的PSO能够在较短时间内找到接近全局最优解的储能配置方案,相比传统方法降低了系统总成本并提高了循环寿命。 适合人群:从事电力系统、新能源技术研究的专业人士,尤其是对储能系统优化感兴趣的科研工作者和技术开发者。 使用场景及目标:适用于需要对混合储能系统进行容量优化的场合,旨在提高储能系统的经济效益和使用寿命,同时保证供电稳定性。通过学习本文提供的理论知识和代码实例,读者能够掌握改进粒子群算法的应用技巧,从而应用于实际工程项目中。 其他说明:文中提到的所有代码均为Python实现,且已在GitHub上提供完整的源代码链接(尽管文中给出的是虚拟地址)。此外,作者还计划将改进的PSO与其他优化算法相结合,进一步提升求解复杂问题的能力。

    2025 长城杯 决赛 二进制 附件 第二届 长城杯 国赛 二进制 附件

    2025 长城杯 决赛 二进制 附件 第二届 长城杯 国赛 二进制 附件

    【实例分享】详解MATLAB实现K均值聚类算法,基于样本数据进行聚类分析

    内容概要:本文详细介绍了K均值聚类算法的基本原理及其在Matlab中的具体实现。首先通过生成随机样本数据进行演示,展示了如何利用Matlab编写K均值聚类的核心代码,包括初始化质心、分配样本以及更新质心的关键步骤。文中还特别强调了距离计算部分使用的向量化操作,提高了程序运行效率。此外,提供了完整的代码示例,涵盖从数据准备到结果可视化的全过程,并讨论了一些常见的问题及解决方案,如初始质心的选择、异常值的影响等。 适合人群:对机器学习感兴趣的学生、研究人员和技术爱好者,尤其是希望深入理解K均值聚类算法内部机制的人士。 使用场景及目标:适用于初学者学习无监督学习的基础算法之一——K均值聚类,帮助他们掌握如何手动实现这一重要算法,同时能够将理论知识应用于实际数据分析任务中。对于想要进一步探索高级特性的用户,则可以参考提供的改进方向。 其他说明:文中提到的数据预处理(如标准化)、模型评估指标(如肘部法则)和潜在的问题(如局部最优解),都为后续研究提供了有价值的指导。

    单元测试革命:用mockall实现完美测试隔离.pdf

    文档支持目录章节跳转同时还支持阅读器左侧大纲显示和章节快速定位,文档内容完整、条理清晰。文档内所有文字、图表、函数、目录等元素均显示正常,无任何异常情况,敬请您放心查阅与使用。文档仅供学习参考,请勿用作商业用途。 Rust 以内存安全、零成本抽象和并发高效的特性,重塑编程体验。无需垃圾回收,却能通过所有权与借用检查机制杜绝空指针、数据竞争等隐患。从底层系统开发到 Web 服务构建,从物联网设备到高性能区块链,它凭借出色的性能和可靠性,成为开发者的全能利器。拥抱 Rust,解锁高效、安全编程新境界!

    语音转文字脚本,实现语音转文字

    可实现语音转文字

    少儿编程scratch项目源代码文件案例素材-功夫 第一关.zip

    少儿编程scratch项目源代码文件案例素材-功夫 第一关.zip

    少儿编程scratch项目源代码文件案例素材-光明与黑暗(1).zip

    少儿编程scratch项目源代码文件案例素材-光明与黑暗(1).zip

    少儿编程scratch项目源代码文件案例素材-多节奏(动画).zip

    少儿编程scratch项目源代码文件案例素材-多节奏(动画).zip

    少儿编程scratch项目源代码文件案例素材-洞穴生存.zip

    少儿编程scratch项目源代码文件案例素材-洞穴生存.zip

    基于UDS的Bootloader:源码与测试用例共享,支持Autosar与多种通信协议定制,包括CANfd,多个版本可选

    内容概要:本文详细介绍了基于UDS(Unified Diagnostic Services)协议的Bootloader的设计与实现,涵盖其多协议支持(XCP、CCP、UDS)、AUTOSAR兼容性、多版本选择(ILLD和MCAL)、广泛硬件平台支持(如TC系列芯片)以及CAN FD的支持。文中不仅提供了上位机和下位机的代码示例,还展示了具体的测试用例,确保Bootloader的功能正确性和稳定性。此外,文章探讨了Bootloader在汽车电子和工业控制系统中的应用场景,强调了其重要性和灵活性。 适合人群:从事汽车电子、嵌入式系统开发的技术人员,尤其是那些需要深入了解Bootloader工作机制和实现细节的人群。 使用场景及目标:适用于需要开发或维护汽车电子控制单元(ECU)的团队,旨在提高系统的可靠性和性能。目标包括但不限于:实现高效的数据传输、确保诊断服务的准确性、优化刷写速度、增强系统的安全性等。 其他说明:文章提供了丰富的代码示例和技术细节,帮助读者更好地理解和应用基于UDS的Bootloader。同时,针对不同硬件平台和应用场景,给出了具体的配置建议和注意事项。

    少儿编程scratch项目源代码文件案例素材-飞行狂热.zip

    少儿编程scratch项目源代码文件案例素材-飞行狂热.zip

    Socket TCP通信C# Winform控件封装,集成简单,服务端与客户端全涵盖,源码及应用案例一键下载

    内容概要:本文详细介绍了在C# Winform环境中实现Socket TCP通信的一种高效方式,即通过封装的服务端和客户端控件来简化开发流程。文中不仅讲解了控件的基本使用方法,如服务端监听、客户端连接、数据传输等核心功能,还探讨了控件内部的工作原理,包括异步通信、事件驱动机制以及线程安全管理等方面。此外,文章还提供了一些典型应用场景的具体实现,如聊天程序、文件传输等,帮助开发者更快地上手并解决实际问题。 适合人群:具有一定C#编程基础,希望快速掌握Socket TCP通信开发的程序员。 使用场景及目标:适用于需要在网络编程中快速搭建稳定可靠的通信系统的项目,旨在提升开发效率,降低开发难度,使开发者能够专注于业务逻辑而非底层通信细节。 其他说明:控件源码公开,便于进一步学习和定制化开发;附带多个应用案例源码,涵盖常见网络通信任务,有助于理解和实践。

    少儿编程scratch项目源代码文件案例素材-愤怒的小鸟躲避.zip

    少儿编程scratch项目源代码文件案例素材-愤怒的小鸟躲避.zip

Global site tag (gtag.js) - Google Analytics