从asp.net Web应用程序访问Interop.office.excel库 [英] Accessing Interop.office.excel library from asp.net web application

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

问题描述

我有一个asp.net Web应用程序,并已部署在Web服务器上.在一种情况下,我有一个固定格式的Excel工作表,该工作表位于Web文件夹中的服务器上.在运行时,我借助于interop.office.excel库在单元格中编写.最初,服务器上没有安装excel,然后我们安装了excel,并从组件服务获得了COM组件的全部权限.但是现在我们正在错误以下.如何解决呢?

i have an asp.net web application and deployed on web server. in a scenario i have a fixed format excel sheet which is on server in a web folder. at runtime i m writing in cell with the help of interop.office.excel library. initially there was no excel installed on server then we have installed excel and given COM component full rights from Component services. but now we are getting below error. How to solve this ?

检测产品'{90110409-6000-11D3-8CFE-0150048383C9}',功能 'OfficeUserData',组件为'{4A31E933-6F67-11D2-AAA2-00A0C90F57B0}' 失败的.资源'HKEY_CURRENT_USER \ Software \ ODBC \ ODBC.INI \ MS Access数据库\'不存在.

Detection of product '{90110409-6000-11D3-8CFE-0150048383C9}', feature 'OfficeUserData', component '{4A31E933-6F67-11D2-AAA2-00A0C90F57B0}' failed. The resource 'HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\MS Access Database\' does not exist.

检测产品'{90110409-6000-11D3-8CFE-0150048383C9}',功能 'ExcelUserData',组件'{8ADD2C96-C8B7-11D1-9C67-0000F81F1B38}' 失败的.资源 'HKEY_CURRENT_USER \ Software \ Microsoft \ Office \ 11.0 \ Excel \ UserData'确实 不存在.

Detection of product '{90110409-6000-11D3-8CFE-0150048383C9}', feature 'ExcelUserData', component '{8ADD2C96-C8B7-11D1-9C67-0000F81F1B38}' failed. The resource 'HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Excel\UserData' does not exist.

推荐答案

有许多选项可以在不使用Interop的情况下读取/编辑/创建Excel文件:

There are many options to read/edit/create Excel files without Interop:

MS提供了免费的OpenXML SDK V 2.0-请参见 http://msdn.microsoft.com/zh-cn/library/bb448854%28office.14%29.aspx (仅适用于XLSX)

MS provides the free OpenXML SDK V 2.0 - see http://msdn.microsoft.com/en-us/library/bb448854%28office.14%29.aspx (XLSX only)

这可以读写MS Office文件(包括Excel).

This can read+write MS Office files (including Excel).

另一个免费选项,请参见 http://www.codeproject.com/KB/office/OpenXML.aspx (仅适用于XLSX)

Another free option see http://www.codeproject.com/KB/office/OpenXML.aspx (XLSX only)

如果您需要更多的东西来处理较旧的Excel版本(例如XLS,不仅是XLSX),渲染,创建PDF,公式等,那么还有不同的免费和商业库,例如 EPPlus (免费,仅限XLSX), Aspose.Cells SpreadsheetGear LibXL Flexcel

IF you need more like handling older Excel versions (like XLS, not only XLSX), rendering, creating PDFs, formulas etc. then there are different free and commercial libraries like ClosedXML (free, XLSX only), EPPlus (free, XLSX only), Aspose.Cells, SpreadsheetGear, LibXL and Flexcel etc.

这篇关于从asp.net Web应用程序访问Interop.office.excel库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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