tags:

views:

223

answers:

8

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 basically 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)...

+2  A: 

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.

code4life
while these are both great libraries the question was regarding excel helper libraries as opposed to standardised 3rd party components that use their own object models/APIs.I've edited my question to make it clearer.
Anonymous Type
+3  A: 

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

Mathias
yeah these are great and essential tools i use them constantly. However I was more looking for helper libraries as opposed to developer tooling for the IDE. Although on reflection the extensions namespaces do provide some very useful extension methods. that are superior to rolling your own.
Anonymous Type
+3  A: 

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.

Mathias
yeah thats a good point. Im going to edit the question since I was more intending this question to be about what libaries pplz have written for VSTO dev work rather than what alternatives and 3rd party library alternatives exist.
Anonymous Type
+3  A: 

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.

Otaku
this is probably the best answer to date. The All-in-one framework is interesting an has a very good implementation of COM interop cleanup patterns. def. worth checking out.
Anonymous Type
+2  A: 

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.

tommieb75
thanks this is a good answer.
Anonymous Type
it is not automation.
Sergey Mirvoda
very true Sergey, however due to two important scenarios of needing to sometimes speed up read/write access of Excel files, and sometimes remove type library/PIA dependancies this is a useful answer.
Anonymous Type
+2  A: 

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.

Sergey Mirvoda
the question was about libraries ppl have written for Excel automation, not which language features are available in .net 4 for working with Excel automation. do you have any examples of using .net 4?
Anonymous Type
@Anonymous Type see update.
Sergey Mirvoda
very cool. nice work Sergey I can see why you are such a fan of .NET 4.0
Anonymous Type
+2  A: 

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.

Alex
+2  A: 

I really like NPOI for 2003/2007 formats

http://npoi.codeplex.com/

Totally standalone and easy to use

MrDosu