在没有安装office的情况下读取excel文件
有没有一种方法可以在.NET 中读取 excel (2003) 文件,而无需安装 Office,甚至可能无需任何第 3 方库?
为了能够使用 VSTO 我想需要安装 Office,对吗?
但是 ADO.NET(例如 Microsoft.Jet.OLEDB.4.0,Extended Properties=Excel 8.0
)怎么样?需要安装Office吗?
同样重要的是,我可以阅读对单元格所做的这些评论:
Is there a way to read in excel (2003) files in .NET without office beeing installed and maybe even without any 3rd party library?
To be able to use VSTO I suppose office needs to be installed, right?
But how about ADO.NET (e.g. Microsoft.Jet.OLEDB.4.0,Extended Properties=Excel 8.0
)? Does it require Office beeing installed?
It is also important that I can read in these comments made to a cell:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您可以/想要使用开源库,可以使用 excellibrary。该库读取和写入 Excel 2003 文件。据我记得你可以发表评论。如果不是 - 编码将很简单,因为所有记录类型都已解码。
您是对的,您需要在计算机上安装 Office 才能使用 VSTO。
据我所知,您将无法通过 ADO 阅读评论。
If you can/want to use an open source library there is excellibrary. The library reads and writes Excel 2003 files. As far as I remember you can get into comments. If not - it would be trivial to coded as all record types are already decoded.
You are correct you need Office to be installed on a machine to be able to use VSTO.
As far as I know you will not be able to read comments via ADO.
如果没有第 3 方库和 Office,事情就会变得非常困难,为什么不说不可能呢?
如果您选择第 3 方库,请使用 NPOI< /a>.从我的经验来看,我可以说这非常好。
要使用 NPOI 阅读注释,请查看以下示例:
http://www.java2s.com/Open-Source/CSharp/GUI/NPOI/TestCases/HSSF/UserModel/TestHSSFComment.cs.htm
查看如何在中设置注释使用 NPOI 的 Cell 查看 示例包 中的 SetCellCommentInXls 项目。
Without 3rd party libraries and Office things get really difficult and why not say impossible.
If you choose a 3rd party library, go with NPOI. From my experience I can tell that it's pretty good.
To read comments with NPOI, take a look at this sample:
http://www.java2s.com/Open-Source/CSharp/GUI/NPOI/TestCases/HSSF/UserModel/TestHSSFComment.cs.htm
To see how to set a comment in a Cell with NPOI take a look at SetCellCommentInXls project inside the Samples package.