无法从ASP.Net Web应用程序中读取excel文件 [英] Unable to read excel file from ASP.Net Web application

查看:80
本文介绍了无法从ASP.Net Web应用程序中读取excel文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试从ASP.Net Web应用程序中读取excel文件时出现以下错误 -



检索具有CLSID的组件的COM类工厂{00024500-0000- 0000-C000-000000000046}由于以下错误而失败:80080005服务器执行失败(来自HRESULT的异常:0x80080005(CO_E_SERVER_EXEC_FAILURE))。

When trying to read excel file from the ASP.Net web application getting following error -

Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80080005 Server execution failed (Exception from HRESULT: 0x80080005 (CO_E_SERVER_EXEC_FAILURE)).

推荐答案

您正在尝试与Excel互操作。 Web应用程序不支持此功能,因为Excel不能同时支持多个请求。



读取这个 [ ^ ]找出原因。
You're trying to do Interop with Excel. This is NOT supported in a web application as Excel doesn't really support multiple requests at the same time.

Read this[^] to find out why.


要使代码正常工作,您需要安装Excel并从您的Web代码中启动。这很难开始工作,并且不受微软支持,也无论如何都无法正常工作。您可以尝试使用Open XML SDK来读取Excel文档,或Excel ODBC驱动程序或Aspose等。



http://typecastexception.com/post/2013/09/25/C-Query- Excel-and-CSV-Files-Using-LinqToExcel.aspx [ ^ ]
To get that code working you'll need Excel installed and launchable from your web code. This is hard to get working, and not supported by Microsoft and won't really work anyway. You can try something like the Open XML SDK to read Excel documents, or the Excel ODBC driver, or Aspose etc.

http://typecastexception.com/post/2013/09/25/C-Query-Excel-and-CSV-Files-Using-LinqToExcel.aspx[^]


这篇关于无法从ASP.Net Web应用程序中读取excel文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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