Table of Contents

Method Add

Namespace
DocWright.Spreadsheet
Assembly
DocWright.Spreadsheet.dll

Add(string, string, IEnumerable<string>, XlsxScenarioOptions?)

Adds a scenario at the end of the sheet's list, with Excel's refusals (measured over COM).

public XlsxScenario Add(string name, string changingCells, IEnumerable<string> values, XlsxScenarioOptions? options = null)

Parameters

name string

The name: 1 to 255 characters, not the name of another of the sheet's scenarios in any case.

changingCells string

The changing cells, as B1:B2 or D1,D3: at most 32 cells.

values IEnumerable<string>

One value for each changing cell, in the cells' order (each range row by row), as typed into Excel's dialog: at most 255 characters each, not a formula.

options XlsxScenarioOptions

The comment, the maker, locked and hidden; null for Excel's defaults.

Returns

XlsxScenario

The scenario.

Exceptions

ArgumentNullException

An argument is null.

ArgumentException

An argument is refused, with the reason.

InvalidOperationException

The sheet is not a worksheet, or is protected against editing scenarios and the workbook honours its protection.