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
namestringThe name: 1 to 255 characters, not the name of another of the sheet's scenarios in any case.
changingCellsstringThe changing cells, as
B1:B2orD1,D3: at most 32 cells.valuesIEnumerable<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.
optionsXlsxScenarioOptionsThe 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.