budul.CsvHelper.Excel 1.0.1

dotnet add package budul.CsvHelper.Excel --version 1.0.1
                    
NuGet\Install-Package budul.CsvHelper.Excel -Version 1.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="budul.CsvHelper.Excel" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="budul.CsvHelper.Excel" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="budul.CsvHelper.Excel" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add budul.CsvHelper.Excel --version 1.0.1
                    
#r "nuget: budul.CsvHelper.Excel, 1.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package budul.CsvHelper.Excel@1.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=budul.CsvHelper.Excel&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=budul.CsvHelper.Excel&version=1.0.1
                    
Install as a Cake Tool

CsvHelper.Excel

License NuGet

CsvHelper.Excel is a .NET library that enables reading and writing Excel files (.xlsx) using CsvHelper conventions, powered by ClosedXML. It provides seamless integration for treating Excel worksheets as CSV-like data, supporting both synchronous and asynchronous operations.

This project is a fork of CsvHelper.Excel by Chris Young.

Features

  • Read and write Excel files using CsvHelper-style APIs
  • Support for multiple worksheets (read/write)
  • Synchronous and asynchronous methods
  • Customizable parsing and writing options (headers, sheet selection, row limits, etc.)
  • Validation of Excel structure against POCOs
  • Batch processing and progress reporting for large datasets
  • Formula injection protection

Installation

Add the NuGet package to your project:

dotnet add package CsvHelper.Excel

Usage

Writing to Excel

using CsvHelper.Excel.Writer;
var records = new List<MyRecord> { /* ... */ }; 
records.WriteToExcel("output.xlsx", "Sheet1");

Reading from Excel

using CsvHelper.Excel.Parser;
var records = "output.xlsx".ReadFromExcel<MyRecord>("Sheet1");

Asynchronous Operations

await records.WriteToExcelAsync("output.xlsx", "Sheet1"); 
var records = await "output.xlsx".ReadFromExcelAsync<MyRecord>("Sheet1");

Advanced Options

You can use WriterOptions and ParserOptions to customize behavior, such as sheet name, header presence, row limits, and progress reporting.

Example: Integration Test

// Write records to Excel
await records.WriteToExcelAsync("data.xlsx", "DataSheet");

// Read records back from Excel
var readRecords = await "data.xlsx".ReadFromExcelAsync<MyRecord>("DataSheet");

Requirements

  • .NET Standard 2.1, .NET 6, .NET 7, or .NET 8
  • CsvHelper >= 30.0.1
  • ClosedXML >= 0.101.0

Limitations

  • Multi-sheet writing is supported, but reading/writing multiple sheets in a single operation may require manual handling.
  • Excel's row and column limits apply (1,048,576 rows, 16,384 columns).

License

See LICENSE for details.


Contributions and issues are welcome!

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 479 8/23/2025
1.0.0 418 8/23/2025