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.
For more information see the wiki
If you want to include ClosedXML in your project, you can install it directly from NuGet
To install ClosedXML, run the following command in the Package Manager Console
PM> Install-Package ClosedXML
ClosedXML allows you to create Excel files without the Excel application. The typical example is creating Excel reports on a web server.
Example:
using (var workbook = new XLWorkbook())
{
var worksheet = workbook.Worksheets.Add("Sample Sheet");
worksheet.Cell("A1").Value = "Hello World!";
worksheet.Cell("A2").FormulaA1 = "=MID(A1, 7, 5)";
workbook.SaveAs("HelloWorld.xlsx");
}
- ClosedXML is not thread-safe. There is no guarantee that parallel operations will work. The underlying OpenXML library is also not thread-safe.
- If you get an exception
The type initializer for 'Gdip' threw an exception.
on Linux, try these solutions.
Be sure to check out our ClosedXML
extension projects
- https://github.com/ClosedXML/ClosedXML.Report
- https://github.com/ClosedXML/ClosedXML.Extensions.AspNet
- https://github.com/ClosedXML/ClosedXML.Extensions.Mvc
- https://github.com/ClosedXML/ClosedXML.Extensions.WebApi
The OpenXML specification is a large and complicated beast. In order for ClosedXML, the wrapper around OpenXML, to support all the features, we rely on community contributions. Before opening an issue to request a new feature, we'd like to urge you to try to implement it yourself and log a pull request.
Please read the full developer guidelines.
- Project originally created by Manuel de Leon
- Current maintainer: Francois Botha
- Master of Computing Patterns: Aleksei Pankratev
- Logo design by @Tobaloidee