0

Can I create an Excel sheet using the C# without having MS Office installed on the host machine?

Michael Petrotta
  • 59,888
  • 27
  • 145
  • 179
Umamaheswaran
  • 3,690
  • 3
  • 29
  • 56
  • 1
    Possible duplicate: [How can I programatically create, read, write an excel without having office installed?](http://stackoverflow.com/questions/1369361/how-can-i-programatically-create-read-write-an-excel-without-having-office-ins) – Alexandre Jun 05 '12 at 05:36

3 Answers3

0

If you are targetting Office 2007+ - you can take a look at the the Office Open XML. Your .xlsm is basically a compressed XML file and as long as you are not doing anything fancy - it should be easy to generate.

If however - you are targeting Office 2003 or earlier - the .xls is a binary format. You might need to look at abiword or star office to see if you can use any of their code to serialize you data to it.

quixver
  • 564
  • 1
  • 4
  • 11
0

I have achieved this using the EPPlus library.

Umamaheswaran
  • 3,690
  • 3
  • 29
  • 56
-1

In the past I've created a simple HTML table and saved as .xls and this has opened fine in Excel.

brianestey
  • 8,202
  • 5
  • 33
  • 48