Skip to content
ifmelatePublic

About

Free (MIT) Excel engine for .NET: reads, recalculates and writes .xlsx. 467 functions checked against Excel, dynamic arrays, LET/LAMBDA, tables, styles, hyperlinks, data validation, protection, custom C# functions.

Topics

Resources

Contributing

Security policy

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

SharpCell

NuGet ci

A free (MIT) Excel formula engine for .NET 8 and later: parser, dependency graph, recalculation, dynamic arrays, LET/LAMBDA, tables with structured references (Sales[Units]) and hidden rows. Correctness is checked against workbooks calculated by real Excel.

Status: 0.x. The API may change between minor versions until 1.0.

Install

dotnet add package SharpCell.Xlsx   # reads and saves .xlsx; brings SharpCell with it
dotnet add package SharpCell        # the engine alone, for workbooks built in code

Usage

using SharpCell;
using SharpCell.Xlsx;
// Read the workbook: sheets, values, formulas and any results Excel saved with them.
Workbook workbook = XlsxReader.Load(path);
Worksheet budget = workbook["Budget"];

// Calculate every formula now instead of relying on saved results.
workbook.Recalculate();
var workbook = new Workbook();
Worksheet sheet = workbook.AddSheet("Sheet1");
sheet["A1"].Value = 2;
sheet["A2"].Formula = "=A1*3";
workbook.Recalculate();
CellValue result = sheet["A2"].Value;   // 6

A runnable version is in samples/SharpCell.Sample. SharpCell.Xlsx reads .xlsx and .xlsm files (not .xls or .xlsb) saves them with your changes, and creates new ones, with data from objects or a DataTable, hyperlinks, data validation and protection (Saving .xlsx files).

Documentation

Support

SharpCell is maintained by one person in spare time, with no support obligations. A bug report needs a small .xlsx that shows the problem and the value Excel calculates; an issue without one is closed. A Workbook is not thread-safe: use one per thread; separate workbooks are independent. Security issues: see SECURITY.md. Contributing: see CONTRIBUTING.md.

About

Free (MIT) Excel engine for .NET: reads, recalculates and writes .xlsx. 467 functions checked against Excel, dynamic arrays, LET/LAMBDA, tables, styles, hyperlinks, data validation, protection, custom C# functions.

Topics

Resources

Contributing

Security policy

Stars

2 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages