Search
Project Description
ClosedXML makes it easier for developers to create Excel 2007/2010 files. It provides a nice object oriented way to manipulate the files (similar to VBA) without dealing with the hassles of XML Documents. It can be used by any .NET language like C# and Visual Basic (VB).

Request #1: If you like this project please make an entry about it in your blog. The more people who use it the better it gets.

Request #2: If you ever find yourself thinking "I wish this API allowed me to do 'this' easier", please let me know about it. There's only so many scenarios I can think of for using this API. I'm very interested in how people work, how they use this API, and what can be done to make your life easier.

What can you do with this?

ClosedXML allows you to create Excel 2007/2010 files without the Excel application. The typical example is creating Excel reports on a web server.

If you've 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();
            var worksheet = workbook.Worksheets.Add("Sample Sheet");
            worksheet.Cell("A1").Value = "Hello World!";
            workbook.SaveAs("HelloWorld.xlsx");


Something more elaborate:

The Documentation page has an example of how to create the following table (Showcase) as well as many other examples:

Showcase.jpg

Development Status

The current build has the following capabilities:
  • Can create new workbooks and modify existing ones (from a file or a stream)
  • Add worksheets
  • Access cells using R1C1, A1, and mixed notations.
  • Add text, dates, time spans, booleans, and numbers to cells
  • Select ranges
  • Create Named Ranges
  • Format cells/ranges
    • Alignments
    • Borders
    • Fills
    • Fonts
    • Numeric/Date formats
  • Traverse a range's columns and rows
  • Merge/Unmerge ranges
  • Insert Columns and Rows
  • Adjust row heights and column widths
  • Convert cell's data types
  • Clear and/or delete ranges
  • Select multiple rows and columns
  • Access the entire page setup dialog
  • Add page breaks
  • Transpose ranges
  • Use lambda expressions on pretty much any object/collection/property
  • Adjust row height and column width to their contents
  • Get/set workbook properties
  • Formulas (both A1 and R1C1 notations)
  • Hide/Unhide Row(s)/Column(s)
  • Outline functionality (grouping of rows and columns)
  • Copying data from IEnumerable Collections
  • Copying Ranges
  • Theme colors
  • Freezing Panes
  • Excel Tables
  • Hyperlinks
  • Many more...
Last edited Jan 31 2011 at 3:51 PM by MDeLeon, version 30
Updating...
© 2006-2012 Microsoft | Get Help | Privacy Statement | Terms of Use | Code of Conduct | Advertise With Us | Version 2012.1.11.18365