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");
}
Be sure to check out our ClosedXML
extension projects
- https://github.com/ClosedXML/ClosedXML.Extensions.AspNet
- https://github.com/ClosedXML/ClosedXML.Extensions.Mvc
Full guidelines to follow later
- Please submit pull requests that are based on the
develop
branch. - Where possible, pull requests should include unit tests that cover as many uses cases as possible. This is especially relevant when implementing Excel functions.
- Install NUnit 3.0 Test Adapter if you want to run the test suite in Visual Studio.
- We use 4 spaces for code indentation. This is the default in Visual Studio. Don't leave any trailing white space at the end of lines or files. To make this easier, ClosedXML has an editorconfig configuration file. It is recommended you install editorconfig from the Visual Studio Extension Manager.
- Project originally created by Manuel de Leon
- Current maintainer: Francois Botha
- Master of Computing Patterns: Aleksei Pankratev
- Logo design by @Tobaloidee