A .NET library for reading, manipulating, and writing Excel 2007+ files with an intuitive API.
ClosedXML is a .NET library that enables developers to programmatically create, read, and modify Excel 2007+ files (.xlsx, .xlsm) without needing Microsoft Excel installed. It serves as a high-level wrapper around the OpenXML SDK, simplifying tasks like generating reports, exporting data, and manipulating spreadsheet content directly from .NET applications. The library abstracts the underlying XML complexity, offering a more intuitive and productive API for Excel automation.
.NET developers who need to generate Excel reports on servers, automate spreadsheet tasks, or integrate Excel file processing into their applications without relying on Excel Interop or complex low-level APIs.
Developers choose ClosedXML because it provides a clean, straightforward API that significantly reduces the learning curve and development time compared to using the raw OpenXML SDK directly. It balances performance for large files with ease of use, making it a go-to solution for server-side Excel generation in .NET ecosystems.
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.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Provides a clean, straightforward interface over the complex OpenXML SDK, as shown in the simple 'Hello World' example where creating a workbook and setting values requires minimal code.
Enables setting and calculating cell formulas directly, allowing for dynamic spreadsheet generation without manual calculations, evidenced by the example formula '=MID(A1, 7, 5)'.
Designed with performance considerations for extensive datasets, with benchmarks showing it can handle up to 1 million rows, though memory usage is high as detailed in the performance section.
Supports .NET Framework and .NET Standard, making it usable in various environments including .NET Core and .NET 5+ applications, as indicated by the badges in the README.
The README explicitly warns that the public API is not stable, requiring developers to read release notes and migration guides for each update, which can introduce breaking changes in production.
Stated in the frequent answers section that ClosedXML is not thread-safe with no guarantees for parallel operations, limiting its use in multi-threaded or high-concurrency scenarios.
Performance tests show significant memory consumption, such as 1.8 GB for a text-only workbook with 1 million rows, which could be prohibitive in resource-constrained environments.
Can throw exceptions related to missing fonts, especially on Linux, requiring manual configuration of fallback fonts, as mentioned in the frequent answers and documentation links.