ClosedXML
ClosedXML is a .NET library for reading, manipulating and writing Excel 2007+ (.xlsx, .xlsm) files. It aims to provide an intuitive and user-friendly interface to dealing with the underlying OpenXML API.
Install the library through .NET CLI
C:\source> dotnet add package ClosedXML
ClosedXML allows you to create Excel files without the Excel application. The typical example is creating Excel reports on a web server.
using var workbook = new XLWorkbook();
var worksheet = workbook.AddWorksheet("Sample Sheet");
worksheet.Cell("A1").Value = "Hello World!";
worksheet.Cell("A2").FormulaA1 = "MID(A1, 7, 5)";
workbook.SaveAs("HelloWorld.xlsx");
Note
These docs are very much a work in progress. If you’d like to contribute, click on the Edit on GitHub link in the right top corner.
- Migration from 0.97 to 0.100
- Strongly typed value of a cell
- Strongly typed cell value
SetDataType
methods removed- Evaluate methods
- Bulk data insert
- Bulk copy cell values
- Rich text connected to cell value
- Copy cell value
- Data type detected removed
- TryGetValue changes
- DateTime pre-1900
- XLClearOptions.DataType removed
- Cast errors throw InvalidCastException
- IXLWorksheet.Search
- Pivot table values use XLCellValue
- CalcEngine errors
- XLError enum moved and order changed
- Value formatting
- Pivot table value field
- XLEventTracking removed
- Strongly typed value of a cell
- Migration from 0.100 to 0.101
- Migration from 0.101 to 0.102
- Migration from 0.102 to 0.103
- Migration from 0.103 to 0.104
Contribute
Issue Tracker: https://github.com/ClosedXML/ClosedXML/issues
Source Code: https://github.com/ClosedXML/ClosedXML