SpreadSheetTasks 1.0.2
dotnet add package SpreadSheetTasks --version 1.0.2
NuGet\Install-Package SpreadSheetTasks -Version 1.0.2
<PackageReference Include="SpreadSheetTasks" Version="1.0.2" />
<PackageVersion Include="SpreadSheetTasks" Version="1.0.2" />
<PackageReference Include="SpreadSheetTasks" />
paket add SpreadSheetTasks --version 1.0.2
#r "nuget: SpreadSheetTasks, 1.0.2"
#:package SpreadSheetTasks@1.0.2
#addin nuget:?package=SpreadSheetTasks&version=1.0.2
#tool nuget:?package=SpreadSheetTasks&version=1.0.2
SpreadSheetTasks
Fast, allocation-conscious .NET support for reading and writing Excel workbooks in
.xlsx and .xlsb formats.
SpreadSheetTasks is designed for data pipelines, backend services, command-line tools and applications that need predictable streaming access to Excel data without requiring Microsoft Excel.
Highlights
- Read and write both XLSX and XLSB files.
- Stream rows with typed getters such as
GetString,GetInt32,GetDoubleandGetDateTime. - Write from
DataTable,IDataReader, object arrays or typed row lists. - Support multiple sheets, autofilters, hidden sheets and cell formatting.
- Update existing
.xlsxand.xlsbsheets while preserving the rest of the workbook. - Update worksheet-backed pivot-cache ranges and mark dependent pivot tables for refresh.
- Targets
net8.0,net9.0andnet10.0. - NativeAOT and trimming analyzers enabled for the library.
Installation
dotnet add package SpreadSheetTasks --version 1.0.1
Or add the package reference manually:
<PackageReference Include="SpreadSheetTasks" Version="1.0.1" />
Quick start
Write an XLSX or XLSB file
using SpreadSheetTasks;
using System.Data;
var table = new DataTable();
table.Columns.Add("Name", typeof(string));
table.Columns.Add("Age", typeof(int));
table.Rows.Add("Alice", 30);
table.Rows.Add("Bob", 25);
using var writer = new XlsxWriter("people.xlsx"); // or XlsbWriter
writer.AddSheet("People");
writer.WriteSheet(table.CreateDataReader());
Read rows without loading the whole workbook
using SpreadSheetTasks;
using var reader = new XlsxOrXlsbReadOrEdit();
reader.Open("people.xlsx");
reader.ActualSheetName = "People";
while (reader.Read())
{
string name = reader.GetString(0);
int age = reader.GetInt32(1);
Console.WriteLine($"{name}: {age}");
}
Write typed rows
using SpreadSheetTasks;
var headers = new List<string> { "Product", "Price", "Quantity" };
var types = new List<TypeCode> { TypeCode.String, TypeCode.Double, TypeCode.Int32 };
var rows = new List<object?[]>
{
new object?[] { "Apple", 1.99, 100 },
new object?[] { "Banana", 0.99, 250 }
};
using var writer = ExcelWriter.CreateWriter("products.xlsx");
writer.AddSheet("Products");
writer.WriteSheet(headers, types, rows, doAutofilter: true);
Update an existing XLSX or XLSB workbook
Use XlsxUpdater for .xlsx and XlsbUpdater for .xlsb. The updater keeps
the original package in memory, replaces only the selected worksheet data and
related pivot-cache metadata, and does not require Microsoft Excel at runtime:
using SpreadSheetTasks;
var rows = new object?[][]
{
["Widget", 50000m],
["Gadget", 75000m]
};
using var updater = new XlsxUpdater("report.xlsx"); // XlsbUpdater for .xlsb
updater.ReplaceSheetData("Data", rows,
new ReplaceSheetDataOptions { Headers = ["Product", "Revenue"] });
updater.Save("report-updated.xlsx");
Save() without an output path safely replaces the source file. ToArray()
can be used when the updated package must be handled as bytes. Only .xlsx
and .xlsb are supported by the updater API.
NativeAOT and trimming
The package enables the .NET AOT and trimming analyzers and is tested with a
published NativeAOT application. The supported package target frameworks are
net8.0, net9.0 and net10.0.
For an application, publish for a concrete runtime identifier:
dotnet publish -c Release -r win-x64 --self-contained true -p:PublishAot=true
The repository contains a runnable AOT smoke test covering XLSX, XLSB,
DataTable, typed list rows and stream writing. See the complete
performance and NativeAOT guide.
Documentation
Performance
The repository includes BenchmarkDotNet projects for regular .NET 10 execution and a focused comparison between .NET 10 JIT and .NET 10 NativeAOT. Benchmark commands, environment details and measured results are maintained in docs/performance-and-aot.md.
Benchmark results depend on CPU, storage, operating system, input files and runtime version. Always reproduce measurements on the target environment before making capacity or latency commitments.
Compatibility notes
Version 1.0.0 introduced the following corrected names:
| Previous name | Current name |
|---|---|
GetScheetNames() |
GetSheetNames() |
DocPopertyProgramName |
DocPropertyProgramName |
SuppressSomeDate |
SuppressYear1000Dates |
overLimit |
maxRows |
UseMemoryStreamInXlsb field |
UseMemoryStreamInXlsb property |
The old members remain available with [Obsolete] warnings where applicable.
License
SpreadSheetTasks is released under the MIT License.
| Product | Versions 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. |
-
net10.0
- No dependencies.
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
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.2 | 51 | 8/30/2026 |
| 1.0.1 | 242 | 8/9/2026 |
| 1.0.0 | 740 | 6/2/2026 |
| 0.6.1 | 151 | 5/30/2026 |
| 0.6.0 | 145 | 5/25/2026 |
| 0.5.0 | 794 | 2/18/2026 |
| 0.4.2 | 811 | 10/24/2025 |
| 0.4.1 | 703 | 7/27/2025 |
| 0.4.0 | 333 | 5/18/2025 |
| 0.3.2 | 726 | 10/23/2024 |
| 0.3.1 | 380 | 8/25/2024 |
| 0.3.0 | 456 | 5/12/2024 |
| 0.2.17 | 516 | 2/16/2024 |
| 0.2.16 | 323 | 2/15/2024 |
| 0.2.14 | 486 | 1/13/2024 |
| 0.2.13 | 337 | 1/6/2024 |
| 0.2.12 | 363 | 11/25/2023 |
| 0.2.11 | 299 | 11/4/2023 |
| 0.2.10 | 302 | 11/4/2023 |
| 0.2.9 | 262 | 11/4/2023 |
Existing XLSX/XLSB worksheet updates with pivot-cache refresh metadata and correct 1904-date-system handling, plus NativeAOT smoke validation.