ExcelHelperEx 1.1.6
dotnet add package ExcelHelperEx --version 1.1.6
NuGet\Install-Package ExcelHelperEx -Version 1.1.6
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="ExcelHelperEx" Version="1.1.6" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ExcelHelperEx" Version="1.1.6" />
<PackageReference Include="ExcelHelperEx" />
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 ExcelHelperEx --version 1.1.6
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: ExcelHelperEx, 1.1.6"
#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 ExcelHelperEx@1.1.6
#: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=ExcelHelperEx&version=1.1.6
#tool nuget:?package=ExcelHelperEx&version=1.1.6
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
ExcelHelperEx
Simple extension methods to save and load lists of POCOs to and from Excel (.xlsx) and CSV files using EPPlus.
Install
Add the NuGet package to your project.
Features
- Save a
List<T>
to.xlsx
or.csv
- Read a
.xlsx
sheet or.csv
intoList<T>
- Maps headers to properties via
DisplayNameAttribute
(preferred) or property name - Case-insensitive header matching, ignores spaces and non-alphanumeric characters
- Supports: string, int, double, decimal, bool, DateTime, DateTime?
Quick start
using System;
using System.Collections.Generic;
using System.ComponentModel;
using ExcelHelperEx;
public class Person
{
[DisplayName("First Name")] public string FirstName { get; set; }
[DisplayName("Last Name")] public string LastName { get; set; }
public int Age { get; set; }
public DateTime? BirthDate { get; set; }
}
var people = new List<Person>
{
new Person { FirstName = "Ada", LastName = "Lovelace", Age = 36, BirthDate = new DateTime(1815, 12, 10) },
new Person { FirstName = "Alan", LastName = "Turing", Age = 41, BirthDate = new DateTime(1912, 6, 23) }
};
// Write
people.SaveToExcel("people.xlsx");
people.SaveToCsv("people.csv");
// Or choose based on extension
people.SaveToExcelOrCsv("people.xlsx");
people.SaveToExcelOrCsv("people.csv");
// Read (Excel)
var fromExcel = "people.xlsx".ReadFromExcel<Person>();
// Read (CSV)
var fromCsv = "people.csv".ReadFromCsv<Person>();
// Read choosing by extension
var auto = "people.xlsx".ReadFromExcelOrCsv<Person>();
Read a specific worksheet
You can target a worksheet by its name or by its zero-based index. If both are provided, the name takes precedence.
// By sheet name
var byName = "people.xlsx".ReadFromExcel<Person>(sheetName: "Employees");
// By sheet index (zero-based)
var byIndex = "people.xlsx".ReadFromExcel<Person>(sheetIndex: 1); // reads the 2nd sheet
// Choosing by extension with sheet selection
var autoByName = "people.xlsx".ReadFromExcelOrCsv<Person>(sheetName: "Employees");
var autoByIndex = "people.xlsx".ReadFromExcelOrCsv<Person>(sheetIndex: 1);
Excel specifics
- The first row is treated as headers and is matched to properties via:
DisplayNameAttribute
on the property, or 2) property name (split into words)
- A worksheet named
data
is created when writing - Date/time cells are formatted as
MM/dd/yyyy HH:mm:ss
- An Excel table style (Medium2) is applied and columns are auto-sized
CSV specifics
- The first line is treated as the header
- DateTime values are formatted using the general ("G") pattern when writing
Header mapping rules
- Matching is case-insensitive
- Spaces and non-alphanumeric characters are ignored
- Examples:
"First Name"
,"First-Name"
,"firstname"
all map to propertyFirstName
Type support
- string, int, double, decimal, bool, DateTime, DateTime?
- Excel numeric dates (OADate) are converted to DateTime when reading
Error handling
- Writing overwrites existing target files
- Reading throws when the source file is not found, or when an Excel sheet is not found
Notes
- EPPlus requires setting the license context in your app before using:
OfficeOpenXml.ExcelPackage.LicenseContext = LicenseContext.NonCommercial;
This library internally sets a non-commercial personal license for convenience, but you should configure it according to your usage scenario.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. 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 was computed. 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 was computed. 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 | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. 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.
-
.NETStandard 2.0
- EPPlus (>= 8.0.8)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on ExcelHelperEx:
Package | Downloads |
---|---|
PrimeNgScraperBase.core
base scraper backend with user manegment |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
1.1.6 | 84 | 8/9/2025 |
1.1.5 | 155 | 9/27/2024 |
1.1.4 | 124 | 8/27/2024 |
1.1.3 | 126 | 8/27/2024 |
1.1.2 | 120 | 8/27/2024 |
1.1.1 | 121 | 8/27/2024 |
1.1.0 | 122 | 8/27/2024 |
1.0.9 | 209 | 9/22/2023 |
1.0.8 | 164 | 9/18/2023 |
1.0.7 | 148 | 9/17/2023 |
1.0.6 | 517 | 7/18/2022 |
1.0.5 | 445 | 10/18/2021 |
1.0.4 | 439 | 10/17/2021 |
1.0.3 | 432 | 5/25/2021 |
1.0.2 | 525 | 3/27/2021 |
1.0.1 | 505 | 3/27/2021 |
1.0.0 | 413 | 3/26/2021 |