Skip to Content
TExcelOverview and scope

TExcel

On this page

TExcel streams .xlsx workbooks and exports CSV. Row-based parsing, batched XML output and reusable typed column bindings reduce worksheet objects and intermediate results. Use TExcel.Excel for single operations, or ExcelReader, ExcelWriter and CsvWriter for multiple sheets, appending, time projection and explicit stream ownership.

Install, write and read back a file

dotnet add package TExcel

Microsoft Excel is not required. The quick start writes devices.xlsx and reads back two records.

Performance at a glance

100,000 typed rowsTExcel mean timeCompared with MiniExcel
Write a complete XLSX182.87 ms82.3% less managed allocation
Read into a list238.77 ms52.5% less time, 84.3% less allocation
Enumerate and count only223.26 ms40.6% less time

From the public .NET 8.0.25 report in the repository README, using the Job with 3 warmups and 10 measured iterations. See performance and large files for scale comparisons, variation and environment. Streaming reduces retained results; shared strings and application-held data still affect memory.

Capabilities

CapabilityEntry point
Typed rowsExcel.Query<T>, Excel.SaveAs
Dynamic columnsDictionary queries, row dictionaries and column dictionaries
Multiple sheets and batchesCreateWriter, WriteSheet, AppendSheet
Original row numbers and cell factsReadSheetRows, ExcelRow, ExcelCell
Column names, order and formattingExcelColumnAttribute
Widths, wrapping, freezing, filtering and printingExcel.ApplyWorksheetDesign
CSV outputSaveAsCsv, CreateCsvWriter
Uploaded archive validationExcelArchiveValidator, ExcelArchiveLimits

Formula calculation, binary .xls, interactive spreadsheet editing, general chart editing and CSV reading are not supported.

Depends on TUtility.Core. Examples use .NET 10.

Reading path

TaskGuide
Read entities, dictionaries or raw cellsReading models
Evaluate throughput and bound memoryPerformance and large files
Export batches or multiple worksheetsStreaming writes
Export a database query to XLSXDatabase export
Set column names, order and conversionsColumn mapping
Set freezing, filters, widths and printingWorksheet design
Export CSVCSV
Validate uploads and manage stream lifetimeArchive safety
Validate rows and report errorsImport validation
Look up signatures and defaultsAPI reference