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 TExcelMicrosoft Excel is not required. The quick start writes devices.xlsx and reads back two records.
Performance at a glance
| 100,000 typed rows | TExcel mean time | Compared with MiniExcel |
|---|---|---|
| Write a complete XLSX | 182.87 ms | 82.3% less managed allocation |
| Read into a list | 238.77 ms | 52.5% less time, 84.3% less allocation |
| Enumerate and count only | 223.26 ms | 40.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
| Capability | Entry point |
|---|---|
| Typed rows | Excel.Query<T>, Excel.SaveAs |
| Dynamic columns | Dictionary queries, row dictionaries and column dictionaries |
| Multiple sheets and batches | CreateWriter, WriteSheet, AppendSheet |
| Original row numbers and cell facts | ReadSheetRows, ExcelRow, ExcelCell |
| Column names, order and formatting | ExcelColumnAttribute |
| Widths, wrapping, freezing, filtering and printing | Excel.ApplyWorksheetDesign |
| CSV output | SaveAsCsv, CreateCsvWriter |
| Uploaded archive validation | ExcelArchiveValidator, 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
| Task | Guide |
|---|---|
| Read entities, dictionaries or raw cells | Reading models |
| Evaluate throughput and bound memory | Performance and large files |
| Export batches or multiple worksheets | Streaming writes |
| Export a database query to XLSX | Database export |
| Set column names, order and conversions | Column mapping |
| Set freezing, filters, widths and printing | Worksheet design |
| Export CSV | CSV |
| Validate uploads and manage stream lifetime | Archive safety |
| Validate rows and report errors | Import validation |
| Look up signatures and defaults | API reference |