可以读/写.xls文件的.NET Excel库 [英] .NET Excel Library that can read/write .xls files

查看:104
本文介绍了可以读/写.xls文件的.NET Excel库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一个读/写.xls(而不是.xlsx)文件的Excel库。



我正在使用 excellibrary ,但它非常错误,我似乎无法打开我创建的文件。这个问题已经知道了将近一年,尚未解决。



我曾经看到另一个线程有人建议 EPPlus ,但只适用于2007/2010 .xlsx格式。



我有过去使用过 Koogra ,并且相当高兴,但我相信只能读取..不要写。



如果你知道一个图书馆,请让我知道这是什么。



编辑:
我很高兴用内置的Microsoft.Office.Interop.Excel创建我的Excel文件,但是我的机器有Office 2007,而目标机器只有Office 2003.我注意到有2个该库的文件版本:12和14.我检查了目标机器上的Excel版本,它是11.8169.8172 - 我假设内置的Excel互操作无法在目标上工作?

决方案

我建议 NPOI 。 NPOI是 FREE ,专用于.XLS文件。它帮助了我很多。



详细信息:如果您使用NPOI,则不需要在您的计算机上安装Microsoft Office来处理.XLS文件。 p>

查看这些博文:



在C#中创建Excel电子表格.XLS和.XLSX



具有Excel表格和动态图表的NPOI



[更新]



NPOI 2.0增加了对XLSX的支持, DOCX。



您可以在这里阅读更多信息:



NPOI 2.0系列帖子安排


I'm looking for an Excel library which reads/writes .xls (not .xlsx) files.

I'm using excellibrary but it's very buggy and I can't seem to open the files I create. The issue has been known for almost a year and hasn't been fixed yet.

I've seen in another thread someone suggested EPPlus, but that only works with the 2007/2010 .xlsx format.

I've used Koogra in the past, and been quite happy with it, but I believe it can only read... not write.

If you know of a library, please let me know what it's called.

Edit: I'm quite happy to create my Excel file with the built-in Microsoft.Office.Interop.Excel if necessary, however my machine has Office 2007 and the target machines only have Office 2003. I noticed I have 2 file versions for that library: 12, and 14. I checked the Excel version on the target machines and it's 11.8169.8172 - I'm assuming that the built-in Excel interop will not work on the target?

解决方案

I'd recommend NPOI. NPOI is FREE and works exclusively with .XLS files. It has helped me a lot.

Detail: you don't need to have Microsoft Office installed on your machine to work with .XLS files if you use NPOI.

Check these blog posts:

Creating Excel spreadsheets .XLS and .XLSX in C#

NPOI with Excel Table and dynamic Chart

[UPDATE]

NPOI 2.0 added support for XLSX and DOCX.

You can read more about it here:

NPOI 2.0 series of posts scheduled

这篇关于可以读/写.xls文件的.NET Excel库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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