Search code examples
c#fileexportoledb

How can I export data to an Excel file


I have an Excel file with data in it. I want to write some specific rows of it to another Excel file that I created by code. By the way I have the indexes of these rows in a list. How can i do that?


Solution

  • MS provides the OpenXML SDK V 2.5 - see https://msdn.microsoft.com/en-us/library/bb448854(v=office.15).aspx

    This can read+write MS Office files (including Excel)...

    Another option see http://www.codeproject.com/KB/office/OpenXML.aspx

    IF you need more like rendering, formulas etc. then there are different commercial libraries like Aspose and Flexcel...