需要简单实用的API才能在C#中使用Excel [英] Needs simple and usefull API to work with Excel in C#
本文介绍了需要简单实用的API才能在C#中使用Excel的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好!
请告诉我一些易于使用的库,以便在.NET中使用Excel 。我需要做什么:
1.使用多张床单创建工作簿。
2.填写数据。
不想使用标准的内置COM库来编写糟糕的代码,例如:
Hi everybody!
Please advise me some easy-to-use library to work with Excel in .NET. What I need to do:
1. Create workbook with multiple sheets.
2. Fill it with data.
Don''t want to use standard built-in COM library to write lousy code like:
Excel.Workbook wb =
ThisApplication.Workbooks.OpenText("C:\\Test.txt",
Type.Missing, 3, Excel.XlTextParsingType.xlDelimited,
Excel.XlTextQualifier.xlTextQualifierDoubleQuote,
Type.Missing, Type.Missing, Type.Missing, True,
Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing);
LINQ to Excel只是检索数据并允许执行查询。
提前谢谢。
LINQ to Excel just retreives data and allows to perform queries.
Thanks in advance.
推荐答案
i发现这个非常有用,因为它不需要安装Excel:
http://code.google.com/p/excellibrary/ [ ^ ]
Excel interop是我推荐VB的少数几个地方之一。 NET over C#纯粹是因为VB.NET能够使用可选参数调用方法签名。如果你在C#中更舒服,你可以在VB中创建一个类库来包装你想要使用的功能,并将库导入你的C#项目。
话虽如此,还有: Excel Reader [ ^ ]
Excel interop is one of the few places where I''d recommend VB.NET over C# purely because of VB.NET''s ability to call method signatures with optional parameters. If you''re more comfortable in C#, you can just create a class library in VB to wrap the functionality you want to use and import the library into your C# project.
That being said, there''s also this: Excel Reader[^]
这篇关于需要简单实用的API才能在C#中使用Excel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文