`
guowee
  • 浏览: 176742 次
  • 性别: Icon_minigender_1
  • 来自: 南京
社区版块
存档分类
最新评论

COM class factory for component with CLSID {000245

    博客分类:
  • .NET
阅读更多

If you add a reference to Microsoft Excel and then try to use it within your ASP.NET application you may receive the following error.

Server Error in '/excel' Application.


Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005.

Example Application

The problem is that by default Microsoft Excel as a COM object can only activated by the following accounts:

  • Administrator
  • System
  • Interactive

When you are running your ASP.Net account on Windows XP your web application is running as the ASPNET account.

The way to resolve this issue is to edit the DCOM configuration settings for the Microsoft Excel Application object.

Configure DCOM

  • Go to the Start-Run menu item.
  • Type in "DCOMCNFG" and hit enter.
  • This should load the "Component Services" MMC (you can also load from Administrative Tools - Component Services"
  • Expand "Component Services"
  • Expand "Computers"
  • Expand "My Computer"
  • Select the "DCOM Config" item
  • Select the "Microsoft Excel Application" item.
  • Right click and select Properties
  • Select the Security Tab and you should see the following:



     
  • Under "Launch and Activation Permissions " select the "Customize " option.
  • Click the "Edit " button

    Windows XP

             

    Windows 2003 Server

     

      
     
  • Click the "Add" button to add a new account to the list.
  • On the dialog that is displayed click the Locations button

    (this is because by default your domain will be selected and we need a local account)

    In this dialog scroll the list to the top (sometimes the first item is not visible) but scroll to the top and select the first item which is your computer name. In the list below "CCROWE" is the name of my computer.



     
  • Click the OK button
  • On the dialog that is displayed enter "ASPNET " as the account name (make sure location is set to the name of the computer that IIS is on) on Windows XP or if you are running on Windows 2003 Server you must enter the account that the Application Pool is running as, by default "Network Service "

    Windows XP

                  

    Windows 2003 Server

    Note : A quicker way on Windows XP is to just enter the computer name and the account
    so in my case that would be:

              ccrowe\ASPNET  

     


  • Click the OK button
  • Now make sure you select the following options for the "ASP.NET Machine Account" or the account that is the application pool identity ( by default Network Service)
     
    • Local Launch         : Allow
    • Remote Launch        : [blank]
    • Local Activation     : Allow
    • Remote Activation    : [blank]

    These settings can be seen below:

  •  

    Windows XP

             

    Windows 2003 Server

     
  • Click the OK button and test your web application again and it should work fine.

Note: Remember if you are running on Windows 2003 Server you must use the application pool identity as the account and not the ASPNET account.

分享到:
评论

相关推荐

    【Excel】Retrieving the COM class factory for component with CLSID

    ### 关于“Retrieving the COM class factory for component with CLSID”问题详解 #### 背景介绍 在使用ASP .NET应用程序操作Excel、Word等Office软件时,有时会在IIS服务器上部署应用过程中遇到错误:...

    Office 2003 组件owc11

    Retrieving the COM class factory for component with CLSID {0002E55D-0000-0000-C000-000000000046} failed due to the following error: 80040154. 收藏 Description: An unhandled exception occurred during ...

    检索 COM 类工厂中 CLSID 为 {000209FF-0000-0000-C000-000000000046} 的组件问题整理

    其中,COM 类工厂是一个创建和管理 COM 组件的 factory,它提供了一个通用的方式来实例化和管理 COM 组件。 在本文中,我们讨论了 COM 类工厂中 CLSID 为 {000209FF-0000-0000-C000-000000000046} 的组件问题,该...

    2008 安装 sqldmo.dll

    Retrieving the COM class factory for component with CLSID {10020200-E260-11CF-AE68-00AA004A34D5} failed due to the following error: 80040154. 而客户又不想在这台电脑安装MSSQL,所以我们只需要在没有安装...

    sql server sqldmo_x86_x64(C#数据库备份还原很好用的dll)

    Retrieving the COM class factory for component with CLSID {10020200-E260-11CF-AE68-00AA004A34D5} failed due to the following error: 80040154. 而客户又不想在这台电脑安装MSSQL,所以我们只需要在没有安装...

    检索COM类工厂中CLSID为{96749377-3391-11D2-9EE3-00C04F797396}的组件失败,解决办法

    错误提示:Retrieving the COM class factory for component with CLSID{96749377-3391-11D2-9EE3-00c04F797396}FAILED DUE TO THE FOLLOWING REEOE :;800700E找不到指定 模块{exception form hresult 0x8007007e}

    检索 COM 类工厂中 CLSID 为 {96749377-3391-11D2-9EE3-00C04F797396} 的组件失败,适用于64位win7

    CLSID(Class Identifier)是每个COM对象的唯一标识,用于定位并创建对应的类工厂,从而实例化该组件。 错误信息"检索COM类工厂中CLSID为{96749377-3391-11D2-9EE3-00C04F797396}的组件失败"表明系统无法找到或者...

    office修复vba软件

    Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80040154 没有注册类 (Exception from HRESULT: 0x80040154 (REGDB_E_...

    .NET中操作word的Microsoft.Office.Interop.Word常见错误解决

    主要用于解决在使用office的dll操作后台word文件时候,在本机运行可以,但是在IIS服务器上会报一个 Retrieving the COM class factory fro component with CLSID {000209FF-0000-C000-000000000046} failed due to ...

    SQL Server 2008 安装SQLDMO.dll的方法

    Retrieving the COM class factory for component with CLSID {10020200-E260-11CF-AE68-00AA004A34D5} failed due to the following error: 80040154. 而客户又不想在这台电脑安装MSSQL,所以我们只需要在没有安装...

    VS2005 水晶报表在时部署时遇到的问题

    Retrieving the COM class factory for component with CLSID {11BD5260-15B6-412D-80DB-12BB60B8FE50} failed due to the following error: 800736b1. Description: An unhandled exception occurred during the ...

    COM IClassFactory接口封装

    在 COM 的设计中,每个 COM 类(CLSID,Class ID)都有一个对应的类工厂对象,实现了 IClassFactory 接口。当需要实例化一个 COM 对象时,首先通过 CLSID 在注册表中找到对应的类工厂,然后通过类工厂创建 COM 对象...

    原创VC编写COM实例 5种方法简单调用COM实例

    `ClassFactory`是你的类工厂类,它负责创建COM对象。 ### 方法五:使用`LoadLibrary`和`GetProcAddress` 对于动态加载COM组件,你可以先使用`LoadLibrary`加载库,然后通过`GetProcAddress`获取`DllGetClassObject...

    深入解析COM技术核心,资源由网络分享整理,如有侵权请联系我

    COM(Component Object Model)技术是微软推出的一种组件对象模型,它允许不同应用...4. **类工厂**:COM组件通过类工厂(Class Factory)实例化,类工厂负责创建组件的实例。客户端通过接口调用类工厂的CreateInsta

    手工创建的Com实例

    3. **类工厂**:COM对象的创建由类工厂(Class Factory)负责,它是一个实现IClassFactory接口的对象。客户端通过调用类工厂的CreateInstance方法来创建新的COM实例。 4. **注册表**:在COM中,对象的元数据(如...

    COM原理与应用源码

    2. CoCreateInstance函数查找注册表,找到对应CLSID的类工厂(Class Factory)。 3. 类工厂创建组件实例,并返回该实例的IUnknown接口指针。 4. 客户端通过IUnknown的QueryInterface方法获取其他接口指针,以调用...

    《COM原理与应用》附书代码 潘爱民

    当应用程序请求创建一个COM对象时,系统会通过CLSID找到相应的类工厂(Class Factory),进而实例化对象。COM对象的生命周期管理由其托管的容器负责,可以是进程内或进程外,这取决于COM对象的实现方式。 潘爱民的...

    COM原理小例子(二)

    COM(Component Object Model)是微软提出的一种软件组件模型,它允许不同编程语言和操作系统环境中的对象互相通信。在本文中,我们将深入探讨COM原理,并通过一个小型实例来演示其核心概念,包括注册表、COM库、类...

    COM技术内幕入门的经典著作

    COM还引入了类工厂(Class Factory)的概念,类工厂负责创建组件实例。每个COM组件都有一个对应的类ID(CLSID),这个ID在注册表中被映射到类工厂,当CoCreateInstance函数被调用时,会根据CLSID找到相应的类工厂并...

Global site tag (gtag.js) - Google Analytics