FormulaEngineer — A Highly Accurate Excel Formula Engine with support for 430+ Excel functions — explore the complete list NEW3.0.1

FormulaEngineer examples

Create, read, and style Excel workbooks in .NET.

Style workbooks as you write them — fonts, fills, borders, number formats, alignment, and layout — using ExcelStyledWriter. Every example below is a complete, runnable snippet.

Group
Example
4 examples in Named styles and themes

Theme colours and font schemes

EnableThemes EnableRichText

Sets a workbook theme and references its accent colours and major font scheme by name rather than by RGB, so the sheet restyles itself if the theme is changed in Excel.

Write.cs
using FormulaEngineer.Api;
using FormulaEngineer.Api.Styling;

var stylingOptions =
    new ExcelStylingOptions
    {
        EnableThemes = true,
        EnableRichText = true
    };

using (var writer = new ExcelStyledWriter("theme-colors-rich-report.xlsx", null, stylingOptions))
{
    writer.SetTheme(ExcelTheme.Office);

    var titleStyle =
        ExcelStyle.Default.With(
            font: ExcelFontStyle.Default.With(
                bold: true,
                size: 16d,
                color: ExcelColor.FromTheme(ExcelThemeColor.Accent1),
                scheme: ExcelFontScheme.Major));

    var richStatus =
        ExcelRichText.From(
            new ExcelRichTextRun("Workbook theme: "),
            new ExcelRichTextRun(
                "Office",
                ExcelFontStyle.Default.With(
                    bold: true,
                    color: ExcelColor.FromTheme(ExcelThemeColor.Accent2))));

    using (var sheet = writer.CreateWorksheet("Theme"))
    {
        sheet.WriteRow(
            new object?[] { "Theme-aware report" },
            titleStyle);

        sheet.WriteRow(richStatus);
        sheet.WriteRow("Accent colors and theme font schemes are stored in the workbook theme part.");
    }

    writer.Close();
}

Style your own workbooks

Styling is part of the same package — no separate install, no Excel, no COM automation.