0

I am updating an internal application that creates excel files based on a template, and I would like to recreate that functionality without having to use the excel interop. Does anyone know of any open source projects that can do this? I was using ExcelLibrary, but it does not work with the template.

Thanks!

EDIT: I am only interested in solutions that are known to work with existing *.xlt or *.xltx templates. Solutions where this is unknown are not helpful. Those can be found all over the web.

Paul
  • 948
  • 8
  • 17
  • This question has been asked here on SO thousands of times,take for example: [Please suggest ways to manipulate Excel spreadsheet without using Excel object as web server does not have MS office installed](http://stackoverflow.com/questions/2643860/please-suggest-ways-to-manipulate-excel-spreadsheet-without-using-excel-object-as) – Doc Brown Aug 20 '11 at 18:48
  • I am specifically looking for a solution that allows the use of templates. This is the only reason I asked. – Paul Aug 20 '11 at 19:29
  • @Doc Brown The reason I am asking is because I don't want to spend several hours testing each of the dozens of libraries available. I am simply hoping that someone will have used one successfully with a template. – Paul Aug 20 '11 at 19:33
  • Why don't you want to use Excel interop? – svick Aug 21 '11 at 01:22
  • @Paul: why do you have to deal with xlt directly, can't you just convert them to xsl once before using them? – Doc Brown Aug 21 '11 at 09:48
  • @svick, because there are a ton of headaches I avoid without using it... – Paul Aug 22 '11 at 10:55
  • @Doc Brown That is a possibility. My concern is preserving a custom header consisting of an image. I'm going to try these suggestions and see if any work for what I need. Otherwise it's back to the interop I guess :/ – Paul Aug 22 '11 at 10:55
  • @Paul, it's quite likely you will just replace them with another set of headaches :-) – svick Aug 22 '11 at 18:48

5 Answers5

0

We've used OpenXml to generate Word documents. I'm sure you can generate Excel files as well.

svick
  • 236,525
  • 50
  • 385
  • 514
Dan
  • 1,927
  • 2
  • 24
  • 35
0

Have a look at the following link, This library allows you to generate Excel Workbooks using XML, hope this help.

CarlosAg Excel Xml Writer Library

Saber Amani
  • 6,409
  • 12
  • 53
  • 88
0

Can you try these libraries depending on whether you want to work with Excel 2003/2007 or 2010.

NPOI

koogra

andres descalzo
  • 14,887
  • 13
  • 64
  • 115
0

Check out the Open XML SDK 2.0 from Microsoft. Then you can use the Simple OOXML project to get you started. Does not work for legacy office documents (i.e. doc/xls) only the new ones like docx and xslx.

hint: a docx/xslx is really a zip file full of xml documents. just change the extension to zip.

Juan Ayala
  • 3,388
  • 2
  • 19
  • 24
0

See OpenXML 2.0 from MS...

It is a free library that does NOT require office to be installed... you can read + write Office files including Excel and Word (Version 2007 and up...).

IF you need more features (like rendering to PDF etc.) and/or support for pre-2007 formats (like XLT) then you would need some 3rd-party library... not opensource... but take a look at Aspose.Cells - it handles XLT, XLTX, XLTM etc. too - for example regarding support for XLTX + XLTM see http://www.aspose.com/documentation/.net-components/aspose.cells-for-.net/feature-overview.html

Yahia
  • 69,653
  • 9
  • 115
  • 144