在C#和asp.net中导出到excel [英] Export to excel in C# and asp.net

查看:105
本文介绍了在C#和asp.net中导出到excel的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用export转换为excel功能并通过代码运行时,它会在我的系统和其他系统上运行,但是当我使用iis或虚拟路径运行时,则会显示以下错误:


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

请帮助解决这个问题.我在iis中有任何更改设置吗?

When i am using export to excel functionality and i run through code then it runs on my system and other systems but when i run using iis or virtual path then it gives below error:


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

Pls help to solve this problem. do i have any change setting in iis.

推荐答案

http: //forums.asp.net/t/1303594.aspx [ ^ ]

也许此链接对您有帮助....:)
http://forums.asp.net/t/1303594.aspx[^]

may this link helps you....:)


好像您正在尝试创建Excel的COM实例,但您不应该在Web服务器上执行此操作.不建议在服务器上使用Excel自动化,最有可能在托管服务器上将其禁用.您看到的错误(80070005)是访问被拒绝",不允许您在运行帐户下创建COM对象.

还有许多其他不依赖于Office Automation的将数据导出到Excel的方法,请在此处通读

^ ]
Looks like you are trying to create a COM instance of Excel, which you should not be doing on a web server. Excel automation on servers is not recommended and is most likely disabled on hosted servers. The error you are seeing (80070005) is ''Access is Denied'', you are not being allowed to create the COM object under the account you are running as.

There are many other ways of exporting data into Excel that do not rely on Office Automation, have a read through here

http://blogs.msdn.com/b/erikaehrli/archive/2009/01/30/how-to-export-data-to-excel-from-an-asp-net-application-avoid-the-file-format-differ-prompt.aspx[^]


这篇关于在C#和asp.net中导出到excel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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