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 Images and shapes

Embedded PNG image

EnableImages

Embeds image bytes directly into the workbook and anchors them to a single cell at a fixed pixel size, so the image travels inside the .xlsx rather than as an external link.

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

var stylingOptions =
    new ExcelStylingOptions
    {
        EnableImages = true
    };

byte[] logoPng =
    Convert.FromBase64String(
        "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+/p9sAAAAASUVORK5CYII=");

using (var writer = new ExcelStyledWriter("embedded-png-image.xlsx", null, stylingOptions))
{
    using (var sheet = writer.CreateWorksheet("Image"))
    {
        sheet.WriteRow("Report with embedded PNG");

        sheet.AddImage(
            ExcelImage.Create(
                logoPng,
                ExcelImageFormat.Png,
                ExcelDrawingAnchor.OneCell(
                    column: 3,
                    row: 2,
                    widthPixels: 160d,
                    heightPixels: 80d),
                name: "Embedded PNG"));
    }

    writer.Close();
}

Style your own workbooks

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