The ClosedXML package will allow developers to create OpenXML files for Excel 2007. It provides a nice object oriented way to manipulate the files (similar to VBA) without dealing with the hassles of XML Documents. It's developed in C# but can be used by any other .NET language.
ClosedXML allows you to create Excel 2007/2010 files without the Excel application. If you ever used the Microsoft Open XML Format SDK you know just how much code you have to write to get the same results as the following 4 lines of code:
- var workbook = new XLWorkbook("Sample.xlsx");
- var worksheet = workbook.Worksheets.Add("Sample Sheet");
- worksheet.Cell("A1").Value = "Hello World!";
- workbook.Save();
· Can create new workbooks
· Add worksheets
· Access cells using R1C1, A1, and mixed notations.
· Add text, dates, booleans, and numbers to cells
· Select ranges (not named ranges though)
· Format cells/ranges
· Alignments
· Borders
· Fills
· Fonts
· Numeric/Date formats
· Traverse a range's columns and rows
Requirements:
· .NET Framework 4.0
What's New in This Release:
· Major performance improvements.
· Added Rich Text functionality.
· Added Phonetic functionality.
· Updated AdjustToContents methods.
· Fixed default column behavior
· Issue of InsertData returns invalid Range
· Setting a cell to an empty string will convert the datatype to Text.
· Rich text composed only of spaces now work.
· Added unit tests
· Added table.Fields property.
· Added ws.Table(index) overload.
· It now throws an error when attempting to retrieve an invalid row/column
· Fixed issues 6838, 6848, 6872, 6859, 6865, 6799