.NET的Excel库,可以读取/写入.xls文件 [英] .NET Excel Library that can read/write .xls files
问题描述
我在找一个Excel库,读/写的.xls(不.xlsx)档案
I'm looking for an Excel library which reads/writes .xls (not .xlsx) files.
我使用的excellibrary 但它是非常错误和我的似乎无法打开我制作的文件。该问题已经知道了将近一年,并且尚未确定
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.
我见过在另一个线程有人建议的EPPlus ,但只适用于在2007/2010的.xlsx格式。
I've seen in another thread someone suggested EPPlus, but that only works with the 2007/2010 .xlsx format.
我用的Koogra 过去,并一直与它很高兴,但我相信它只能读取......不写。
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.
编辑:
我很高兴创建我的Excel文件与内置的Microsoft.Office.Interop.Excel如果有必要,但是我的机器有Office 2007和目标机器只有Office 2003中。我发现我有这个库2文件版本:12和14我查在目标计算机上的Excel版本,它的11.8169.8172 - 我假设内置Excel的互操作将无法在该目标而努力。
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?
推荐答案
我建议你 NPOI 。 NPOI是的免费并与.xls文件专门工作。它已经帮了我很多。
I'd recommend NPOI. NPOI is FREE and works exclusively with .XLS files. It has helped me a lot.
详细信息:你不需要有你的机器上安装了Microsoft Office,如果您使用NPOI与.xls文件工作
Detail: you don't need to have Microsoft Office installed on your machine to work with .XLS files if you use NPOI.
检查这些博客文章:
的在C#创建的Excel电子表格.xls和.XLSX
Creating Excel spreadsheets .XLS and .XLSX in C#
[更新]
NPOI 2.0增加了对XLSX和DOCX的支持。
NPOI 2.0 added support for XLSX and DOCX.
您可以阅读更多关于它在这里:
You can read more about it here:
这篇关于.NET的Excel库,可以读取/写入.xls文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!