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

Two-cell anchored image

EnableImages

Anchors an image across a cell range instead of at a fixed size, so it resizes with the rows and columns beneath it, and carries a description for screen readers.

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

var stylingOptions =
    new ExcelStylingOptions
    {
        EnableImages = true
    };

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

using (var writer = new ExcelStyledWriter("two-cell-anchored-image.xlsx", null, stylingOptions))
{
    using (var sheet = writer.CreateWorksheet("Anchors"))
    {
        sheet.WriteRow("Image placed with a two-cell anchor");

        sheet.AddImage(
            ExcelImage.Create(
                bannerPng,
                ExcelImageFormat.Png,
                ExcelDrawingAnchor.TwoCell(
                    fromColumn: 2,
                    fromRow: 3,
                    toColumn: 6,
                    toRow: 9),
                name: "Two cell banner",
                description: "Image locked to a worksheet range"));
    }

    writer.Close();
}

Style your own workbooks

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