Excel.Application创建问题 [英] Problem with Excel.Application creation

查看:144
本文介绍了Excel.Application创建问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从.net应用程序生成Excel.
在本地系统中,一切正常.
在服务器系统中,excel代码页面出错.

在服务器中,我没有安装MS Office,也没有安装MS Office的权限.

我得到的错误:

由于以下错误,检索具有CLSID {00024500-0000-0000-C000-000000000046}的组件的COM类工厂失败:80070005.

源错误:

第39行:Excel.Application objXL =新的Excel.Application();


为避免此错误,我在web.config
中添加了一个程序集
< add assembly ="Microsoft.Office.Interop.Excel,Version = 11.0.0.0,Culture = neutral,PublicKeyToken = 71e9bce111e9429c">

如果我在web.config中添加此条目,则出现以下错误

无法加载文件或程序集"microsoft.office.interop.excel版本11.0.0.0与文化无关,PublicKeyToken = 71e9bce111e9429c"或其依赖项之一.系统找不到指定的内容.


请为我建议解决此问题的方法

我应该在垃圾箱中插入哪些dll,以及为此

解决方案

服务器上没有MS Office还要进行哪些其他更改,您正在使用IIS吗?

它会在本地运行,因为我假设您在计算机上安装了Office,但是当它尝试从服务器进行访问时,它将遇到找不到"的情况.

使用IIS从您的计算机上调用Excel,或者更好的是,获得许可并将Office套件放在服务器上.


感谢您的回复....

如何从IIS调用excel. 将您的DLL"Interop.EXCEL"放入GAC(只需将DLL拖放到C:\ Windows \ Assembly ).

希望对您有帮助


I am generating excel from .net application.
In local system everything working fine.
In server system,getting error with the pages of excel code.

In server I don''t have installed MS office and don''t have permissions to install MS office.

Error I am getting:

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

Source Error:

Line 39: Excel.Application objXL = new Excel.Application();


To avoid this error I have added one assembly in web.config

<add assembly="Microsoft.Office.Interop.Excel, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">

if I add this entry in web.config then it''s giving me following error

could not load file or assembly ''microsoft.office.interop.excel version 11.0.0.0 culture neutral, PublicKeyToken=71e9bce111e9429c'' or one of its dependencies. The system can not find the specified.


please suggest me solution for this problem

which dll''s I should inculde in the bin and what other changes I need to do for this

解决方案

Not having MS Office on the server will be a problem, and are you using IIS?

It will work locally, for I assume you have Office on the machine, but when it is trying to access from the server it will run into a ''Cannot Find'' situation.

Use IIS to call the Excel from your machine, or, better still, get permission and put the office suite on the server.


Thanks for your reply....

how can I call excel from IIS..?


Either Install Office suite on server or register DLL in GAC
Put your DLL "Interop.EXCEL" in GAC (just drag and drop DLL to C:\Windows\Assembly).

Hope it helps


这篇关于Excel.Application创建问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆