服务器中使用Com组建处理Excel 常见问题

1.Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005 拒绝访问。 (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).

此问题出现有多种原因,要么找不到Com,要么没有权限访问Com

需要在Com组件中 配置 Excel Application的安全权限。

在Server 2008 64位中 需要 以32访问的方式处理 com权限 方法:

1.运行 mmc- 32 

2.添加 管理单元 找到 组件服务 。 找到 Excel application 在安全中 全部改为自定义 ,并配置 权限。

以上可以解决 此问题。

2.Exception from HRESULT: 0x800A03EC

出现这个问题 主要可能有 数据不规范,访问权限不够。

需要验证数据中 是否有 “=”等特殊符号、

如果 还有此类问题

需要 在C:\Windows\System32\config\systemprofile和C:\Windows\SysWOW64\config\systemprofile目录下创建名为Desktop目录

Server 2008 环境

  (如果 程序池的 标识为 NewWork Service 或其他)  此配置需要 改动为 Localsystem

为什么要配置为 localsystem ?

   我感觉是权限不够,在server 2008 中 没法配置 windows 目录的权限,如果要操作excel等 我觉得一定要 用localsystem。

原文地址:https://www.cnblogs.com/shikyoh/p/2298200.html