[]
Creates a new scenario and adds it to the list of scenarios in the current worksheet.
IScenario Add(string name, IRange changingCells, List<object> values = null, string comment = null, bool locked = true, bool hidden = false)
Function Add(name As String, changingCells As IRange, Optional values As List(Of Object) = Nothing, Optional comment As String = Nothing, Optional locked As Boolean = True, Optional hidden As Boolean = False) As IScenario
Type | Name | Description |
---|---|---|
string | name | The scenario name. |
IRange | changingCells | A Range object that refers to the changing cells for the scenario. |
List<object> | values | A list that contains the scenario values for the cells in ChangingCells. If this argument is omitted, the scenario values are assumed to be the current values in the cells in ChangingCells. |
string | comment | A string that specifies comment text for the scenario. If this argument is omitted, the author's name(Document Solutions for Excel) and date are automatically added as the comment text. |
bool | locked | True to lock the scenario to prevent changes. The default value is True. |
bool | hidden | True to hide the scenario. The default value is False. |