开发者

What if any links exist to free Excel "helper" class libraries for C#?

I'm looking for any available free Excel "helper" classes that are written for .net (doesn't have to be C#). I'd like to evaluate what others consider to be useful and generic static (and non static) helper methods. Can be targeted at VSTO or regular Office automation, although that probably doesn't matter.

I guess I should also point out that this question is NOT asking for "what are good alternatives (or free alternatives) to using Excel object model automation. I don't really want links to SS gear, etc, although they are all great products that's not the purpose of the question.

In case I wasn't clear enough in the previous paragraph: I don't want answers that state - use this free (or not free) 3rd party component, instead of Excel object model code.

So basical开发者_Python百科ly what i was asking for was user developed C# code libraries that contain VSTO, Office or Excel helper functions such as static methods for working with menus, ribbons, ranges, workbooks, documents, xml (such as the ones otaku mentioned)...


VSTO Power Tools is a good set of utilities to work with Excel:
http://msdn.microsoft.com/en-us/magazine/dd263100.aspx


ExcelDNA is a very cool project. It provides a lightweight way to consume .NET code from Excel, with a deployment model which is much easier than VSTO. I found it an interesting alternative to VSTO if you want to write UDF in .NET for instance.


In terms of Office automation for Excel, there are some good PowerShell Open XML cmdlets that can be used for PS or ported to C# at Announcing the Release of PowerTools for Open XML V1.1. Eric White's blog, where this link is, has recently done an more in depth look at Excel automation using Open XML, like Table Markup in Open XML SpreadsheetML. Note about Open XML - although it is the preferred method by many, you don't actually have to use the Open XML SDK - you can just use System.IO.Packaging to gain access to Excel 2007/2010 files.

Also, often overlooked, but the Excel snippets available for VSTO, Open XML and Interop development are great. 1, 2, 3

Also, check out the Excel samples for VB @ http://msdn.microsoft.com/en-us/library/8x19fbw1(v=VS.90).aspx. These come installed with VS when you also choose VB as a language during the install.

Update: Just discovered the All-In-One Code Framework (Office) which has a lot of great Excel helper classes. You can find it on: http://1code.codeplex.com/releases/view/51868.


For VSTO projects:

http://www.add-in-express.com/

Non-VSTO, non-automation:

http://www.html-to-pdf.net/excel-library.aspx

Note: neither of these libraries are free.


There's one called FileHelpers which enables you to save Excel data as CSV and the FileHelpers library can easily parse the information and so on, sure it may not be fully blown Excel automation, but it is a good headway to parsing. If you're talking about being able to deal with Excel in a native binary fashion, then this article from CodeProject might help, also here, is BIFF parser that understand the underlying excel data storage, and also here on CodeProject.


With .net 4.0 dynamic keyword writing Excel automation easy as hell.
If you want intellisense you can easily write c# wrapper on top of dynamic calls.

UPDATE
We are working with Excel automation since 2001 (developing financial addins).From Excel 2000 up to 2010.

And all we know that standard interop simply does not work when your code should work with all versions and service packs of Office.

We had beaten many times by custom interop libraries, VSTO versions, etc. After a year we found a only one solution that works - call all automation via late bound calls (reflection). i.e. (''notepad code'') Type.GetTypeFromProgId('Excel.Application').GetMethod('Visible').Invoke(....).

But code was very big and ugly, then we simply wrap that ugly code with Object Model copied from Excel 1:1. When we need new method we add it to our Excel Object model and call excel automation via late bound call.

With new dynamic keyword it is possible to live without wrapper especially with Resharper's dynamic support.


I prefer this one:

Excel Package on CodePlex

it uses the Open XML, so no need for an office install on the computer (may or may not factor in), but I found it very easy to use and set up.


I really like NPOI for 2003/2007 formats

http://npoi.codeplex.com/

Totally standalone and easy to use

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜