Method Add
- Namespace
- DocWright.Spreadsheet
- Assembly
- DocWright.Spreadsheet.dll
Add(XlsxFormControlKind, string, XlsxFormControlOptions?)
Adds a form control at a cell, as Excel's Developer › Insert adds one: its properties part, its entry in the sheet's control list, its shape in the drawing and in the legacy drawing (the four places Excel keeps one), with Excel's defaults for its kind.
public XlsxFormControl Add(XlsxFormControlKind kind, string cell, XlsxFormControlOptions? options = null)
Parameters
kindXlsxFormControlKindThe control's kind (not Other).
cellstringWhere its top-left corner goes, as
B3.optionsXlsxFormControlOptionsIts name, linked cell, list range, caption and size.
Returns
- XlsxFormControl
The control.
Exceptions
- ArgumentNullException
cellis null.- ArgumentException
The kind is Other; the cell is not a reference; a size is not positive; the name is taken.
- InvalidOperationException
The sheet is not a worksheet, or its drawings hold more objects than one legacy drawing block (1,023).