netaera.OpenXml.Excel 1.2.5

dotnet add package netaera.OpenXml.Excel --version 1.2.5
                    
NuGet\Install-Package netaera.OpenXml.Excel -Version 1.2.5
                    
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="netaera.OpenXml.Excel" Version="1.2.5" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="netaera.OpenXml.Excel" Version="1.2.5" />
                    
Directory.Packages.props
<PackageReference Include="netaera.OpenXml.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 netaera.OpenXml.Excel --version 1.2.5
                    
#r "nuget: netaera.OpenXml.Excel, 1.2.5"
                    
#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 netaera.OpenXml.Excel@1.2.5
                    
#: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=netaera.OpenXml.Excel&version=1.2.5
                    
Install as a Cake Addin
#tool nuget:?package=netaera.OpenXml.Excel&version=1.2.5
                    
Install as a Cake Tool

netaera.OpenXml.Excel

netaera.OpenXml.Excel is a powerful OpenXML-based library for processing Excel files in C#.

🔹 Features

  • Read, write, and create Excel files using OpenXml.
  • Optimized API for easy integration.
  • NuGet support for quick installation in projects.

💿 Installation

Install the package via NuGet:

dotnet add package netaera.OpenXml.Excel

Or in Visual Studio:

  1. Open the NuGet Package Manager.
  2. Search for netaera.OpenXml.Excel.
  3. Install the package.

📖 Usage Examples


// Reads data from the first sheet in the document "data.xlsx" and 
// converts the data to the data types specified in the 'ColumnInfos' configuration.
var reader = DocumentBuilder.Build(doc => doc.FileName = "data.xlsx").BuildReader();
ISheetDataRows dataRows = reader.Read(r =>
{
    r.ColumnInfos
        .Add("A", DataType.Integer)
        .Add("B")
        .Add("C", DataType.OADate)      // Returns the OADate value from the Excel data.
        .Add("C", DataType.DateTime)
        .Add("D", DataType.Boolean)
        .Add("E", DataType.Currency)
        ;
});

// Writes the data to columns `A`, `B`, `E`, `G`, and `I`. Column `E` contains a date, and column `I` contains a decimal currency amount.
var writer = CreatorBuilder.Build(cb => { cb.FileName = path; cb.DefaultSheetName = sheetName; })
    .Create()       // Erstellt eine Instanz von IDocument
    .BuildWriter(wc =>
    {
        wc.Values = dataRows;
        wc.ColumnInfos.Add("A").Add("B", DataType.Integer).Add("E", DataType.OADate).Add("G").Add("I", DataType.Currency);
    });
var result = writer.Write();
if (result is false)
	DebugInfo.WriteLine(writer.Messages);

// Reads all data from the first sheet in the document "data.xlsx"
var dataRows = DocumentBuilder.Build(config => config.FileName = "data.xlsx")
    .BuildReader()
    .Read();

// Reads all data from the worksheet named 'Data' in the file "data.xlsx", starting from cell B2
ISheetDataRows dataRows = reader.Read(r =>
{
    r.SheetName = "Data";
    r.FromCellAddress = "B2";
});

// Reads the first 100 cells from columns B, D, E, and F based on column names
var rows = DocumentBuilder.Build(doc => doc.FileName = "data.xlsx").BuildReader(r =>
{
    r.ColumnInfos.InitializeWith (new String[] { "B", "D", "E", "F" });
    r.RowCount = 100;
}).Read();

// Reads the first 100 cells for columns 1 to 8 and marks the first row as a header row
var rows = DocumentBuilder.Build(doc => doc.FileName = "data.xlsx").BuildReader(r =>
{
    r.FromColumn = 1;
    r.ToColumn = 8;
    r.RowCount = 100;
    r.FirstRowIsHeaderRow = true;
}).Read();

// Reads all cells starting from cell A2
var rows = DocumentBuilder.Build(doc => doc.FileName = "data.xlsx").BuildReader(r =>
{
    r.FromCellAddress = "A2";
}).Read();

// Reads all cells within the range from B2 (top-left corner) to E22 (bottom-right corner)
var rows = DocumentBuilder.Build(doc => doc.FileName = "data.xlsx").BuildReader(r =>
{
    r.FromCellAddress = "B2";
    r.ToCellAddress = "E22";
}).Read();

// Provides direct access to the underlying SpreadsheetDocument
var document = DocumentBuilder.Build(doc => doc.FileName = "data.xlsx").Open();
var spreadsheet = document.SpreadsheetDocument;


⚖ License

This package can be freely used without restrictions.
However, the source code must not be copied, decompiled, modified, or published.
See LICENSE for further details.


© 2025 Paul Berthold Goebel - creativesource. All rights reserved.

Product Compatible and additional computed target framework versions.
.NET 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 is compatible.  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 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on netaera.OpenXml.Excel:

Package Downloads
netaera.OpenXml.Excel.SheetMapper

netaera.OpenXml.Excel.SheetMapper is a powerful extension for the netaera.OpenXml.Excel library that enables automated, attribute‑based mapping of Excel data directly to strongly‑typed DTOs. Build robust data import and transformation pipelines for business applications with support for custom type converters and complex data structures.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.2.5 128 3/22/2026
1.2.2 238 9/11/2025
1.2.0 625 7/23/2025
1.1.4 187 6/27/2025
1.1.2 339 6/13/2025
1.1.1 227 5/28/2025
1.1.0 193 5/23/2025
1.0.8 274 5/16/2025

Version 1.2.4:
- The version of the dependency `DocumentFormat.OpenXml` has been updated from `3.1.1` to `3.5.1`.
- The version of the dependency `netaera.Common` has been updated from `3.0.2` to `3.1.19`.

Version 1.2.2:
- The version of the dependency `netaera.Common` has been updated from `3.0.0` to `3.0.2`.

Version 1.2.1:
- Some minor adjustments to netaera.Common 3.0.0, netaera.OpenXml.Excel 1.2.1

Version 1.2.0:
- Added support for Excel's built-in number formats via `ExcelStandardFormat` enum
- Introduced `CustomFormat` handling for precise control over date, time, and currency formatting
- New global configuration option: `DefaultDateFormat` for consistent date output
- Improved stability in value converters, especially when reading cells with mismatched data types
- Enhanced handling of `DataType.OADate` and `DataType.DateTime` to ensure correct Excel rendering
- All format assignments now unified through consistent `StyleIndex` resolution logic

Version 1.1.4:
- Data types are now also taken into account when reading data.
– Improvements to error forwarding in 'Fluent UI Design'
– Now also available for the .NET 9 target platform.

Version 1.1.2:
- Data types can be specified for each column in the configuration.
- Data can now be written for specific columns.
- The `ColumnNames` configuration property is obsolete (will be removed in future versions); the tasks will be replaced by `ColumnInfos` property.

Version 1.1.1:
- More Base-Classes for easier (intern) handling of Excel files

Version 1.0.9:
- Corrections to row indexes
- Performance improvements
- More examples (README.md)

Version 1.0.8:
- Improvements

Version 1.0.6:
- Provides fluent API for reading, writing, and creating Excel files

Version 1.0.0:

Version 1.0.0:
- Initial release of netaera.OpenXml.Excel