Skip to main content

XLibur

XLibur logo

Build and Test NuGet NuGet Downloads SonarCloud Quality Gate License: MIT

About

XLibur is a .NET 8+ library for reading, manipulating, and writing Excel 2007+ (.xlsx, .xlsm) files. It provides an intuitive interface over the underlying OpenXML API.

XLibur was forked from ClosedXML v0.105.0 (May 2025), created to ship patches and improvements that didn't land upstream. Namespaces are prefixed with XLibur to avoid conflicts with ClosedXML if both are referenced in the same project.

Usage

XLibur lets you create and manipulate Excel files without Excel installed — a common use case is generating reports on a web server.

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");
}

Head to Getting Started for installation and a tour of the common read/write operations.

Report templating

The companion XLibur.Report package generates reports from .xlsx templates: author the report in Excel — placeholder expressions, a defined name over the rows to repeat, tag markers for totals and grouping — bind .NET data to it, and generate the finished workbook. Charts, pivot tables and pictures survive range expansion.

using var template = new XLTemplate("SalesReport.xlsx");
template.AddVariable("Company", "Contoso");
template.AddVariable("Sales", sales);
template.Generate();
template.SaveAs("SalesReport-2026.xlsx");

See Report Templating.

Migration from ClosedXML

The public API surface is largely unchanged from ClosedXML 0.105 — migrating is mostly a namespace rename, with font engine configuration as the one packaging difference. See Migration from ClosedXML.