An idiomatic, immutable, fluent C# wrapper over Kookerella.FsOpenXmlDsl โ€” build and read Excel workbooks (.xlsx/.xlsm) from C# without touching F# discriminated unions or option types directly. Every type is an immutable C# record; every With*/As* method returns a new instance rather than mutating in place, so a style or sheet can be built once and safely reused.

Like the F# core it wraps, this can also decompile an existing .xlsx/.xlsm into idiomatic, runnable C# source that rebuilds it โ€” read a real spreadsheet, get back the code that builds it.

Quick start

using Kookerella.CsOpenXmlDsl;

var headerStyle = CellStyle.Default.AsBold().WithFillColor(new RgbColor(220, 220, 220));

var sheet = Sheet.Create("Sheet1",
    Row.Of(
        Cell.Text("Item").WithStyle(headerStyle),
        Cell.Text("Amount").WithStyle(headerStyle)),
    Row.Of(
        Cell.Text("Widgets"),
        Cell.Number(42.5)));

WorkbookIO.Save(Workbook.Create(sheet), "out.xlsx");

var roundTripped = WorkbookIO.Load("out.xlsx");

Install

dotnet add package Kookerella.CsOpenXmlDsl

License

MIT licensed.

See the GitHub repository for the full feature list โ€” merged ranges, tables, charts, pivot tables, and more, all in the same fluent style.