Table of Contents

Method Add

Namespace
DocWright.Spreadsheet
Assembly
DocWright.Spreadsheet.dll

Add(string, string, XlsxShapeOptions?)

Adds a shape of a preset geometry at a cell, as Excel's Insert Shapes adds one: its top-left corner at the cell's, the theme's look, and its text if given.

public XlsxShape Add(string preset, string cell, XlsxShapeOptions? options = null)

Parameters

preset string

A DrawingML preset name, as rect, roundRect, ellipse, rightArrow (one of the 187 ECMA-376 presets).

cell string

Where its top-left corner goes, as B3.

options XlsxShapeOptions

Its name, text, size, fill, or that it is a text box.

Returns

XlsxShape

The shape.

Exceptions

ArgumentNullException

preset or cell is null.

ArgumentException

The preset is not one of DrawingML's; the cell is not a reference; a size is not positive.

InvalidOperationException

The sheet is not a worksheet.