zoukankan      html  css  js  c++  java
  • 在Windows2003Server上配置Microsoft Excel、Microsoft Word应用程序权限时error:8000401a 的解决方法

    Server Error in '/' Application.
    --------------------------------------------------------------------------------

    Retrieving the COM
    class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 8000401a.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace
    for more information about the error and where it originated in the code.

    Exception Details: System.Runtime.InteropServices.COMException: Retrieving the COM
    class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 8000401a.

    Source Error:


    Line
    175:       
    Line
    176:        //创建一个名为WordApp的组件对象
    Line 177:         Word.Application WordApp = new Word.ApplicationClass();
    Line
    178:        //创建一个名为WordDoc的文档对象
    Line 179:         Word.Document WordDoc = WordApp.Documents.Add(ref Nothing, ref Nothing, ref Nothing, ref Nothing);



    Stack Trace:


    [COMException (
    0x8000401a): Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 8000401a.]
        SafetyTrainingManagement_TrainingManagement_CertificationTraining_TrainingTaskReleaseAdd.btnSubmit_Click(Object sender, EventArgs e)
    in d:\AffairProject\SafetyTrainingManagement\TrainingManagement\CertificationTraining\TrainingTaskReleaseAdd.aspx.cs:177
        System.Web.UI.WebControls.Button.OnClick(EventArgs e)
    +105
        System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
    +107
        System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
    +7
        System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
    +11
        System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
    +33
        System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    +5102




    --------------------------------------------------------------------------------
    Version Information: Microsoft .NET Framework Version:
    2.0.50727.832; ASP.NET Version:2.0.50727.832



    这个问题困扰了我很久,在网上找了很多资料都没用,

    最后找到解决方案:

    运行dcomcnfg打开组件服务,

    依次展开"组件服务"->"计算机"->"我的电脑"->"DCOM配置"

    找到"Microsoft Excel应用程序"或"Microsoft Word应用程序",

    右键打开属性对话框,点击"标识"选项卡,

    点"下列用户",把管理员的用户密码正确填写进去...??

        实测发现:选择"启动用户"也可以解决问题,填入管理员的帐号和密码不现实

    点击"安全"选项卡,

    依次把"启动和激活权限","访问权限","配置权限",都选择为自定义,

    然后依次点击它们的编辑,把everyone添加进去,并加入所有的权限...

    OK,解决此问题!


    在创建 EXCEL 应用程序时出现错误:

    检索 COM 类工厂中 CLSID 为 {00024500-0000-0000-C000-000000000046} 的组件时失败,原因是出现以下错误: 80070005

    解决办法: 配置 DCOM 中 EXCEL 应用程序:

    要在交互式用户帐户下设置 Office 自动化服务器,请按照下列步骤操作:
    1. 以管理员身份登录到计算机,并使用完整安装来安装(或重新安装)Office。为了实现系统的可靠性,建议您将 Office CD-ROM 中的内容复制到本地驱动器并从此位置安装 Office。
    2. 启动要自动运行的 Office 应用程序。这会强制该应用程序进行自我注册。
    3. 运行该应用程序后,请按 Alt+F11 以加载 Microsoft Visual Basic for Applications (VBA) 编辑器。这会强制 VBA 进行初始化。
    4. 关闭应用程序,包括 VBA。
    5. 单击开始,单击运行,然后键入 DCOMCNFG。选择要自动运行的应用程序。应用程序名称如下所示:
    Microsoft Access 97 - Microsoft Access 数据库
    Microsoft Access 2000/2002 - Microsoft Access 应用程序
    Microsoft Excel 97/2000/2002 - Microsoft Excel 应用程序
    Microsoft Word 97 - Microsoft Word Basic
    Microsoft Word 2000/2002 - Microsoft Word 文档
    单击属性打开此应用程序的属性对话框。
    6. 单击安全选项卡。验证使用默认的访问权限使用默认的启动权限已选中。
    7. 单击标识选项卡,然后选择交互式用户
    8. 单击确定,关闭属性对话框并返回主应用程序列表对话框。
    9. DCOM 配置对话框中,单击默认安全性选项卡。
    10. 单击访问权限的编辑默认值。验证访问权限中是否列出下列用户,如果没有列出,则添加这些用户:
    SYSTEM
    INTERACTIVE
    Everyone
    Administrators
    IUSR_<machinename>*
    IWAM_<machinename>*

    * 这些帐户仅在计算机上安装了 Internet Information Server (IIS) 的情况下才存在。
    11. 确保允许每个用户访问,然后单击确定
    12. 单击启动权限的编辑默认值。验证启动权限中是否列出下列用户,如果没有列出,则添加这些用户:
    SYSTEM
    INTERACTIVE
    Everyone
    Administrators
    IUSR_<machinename>*
    IWAM_<machinename>*

    * 这些帐户仅在计算机上安装有 IIS 的情况下才存在。
    13. 确保允许每个用户访问,然后单击确定
    14. 单击确定关闭 DCOMCNFG。
  • 相关阅读:
    PIC18F2455/2550/4455/4550之通用串行总线USB
    今天,一个新的起点
    WM_COPYDATA消息
    图片浏览(附带样式+效果)
    这条路,走远一点,再远一点
    html之table(10种表格)
    数据导出成Excel
    .net 附件下载
    .net Repeater嵌套的数据绑定问题
    AjaxPro.2.dll的使用方法,以实例讲解。
  • 原文地址:https://www.cnblogs.com/ymyglhb/p/1505620.html
Copyright © 2011-2022 走看看