[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.IScenarios.Add

Add Method

Add(string, IRange, List<object>, string, bool, bool)

Creates a new scenario and adds it to the list of scenarios in the current worksheet.

Declaration
IScenario Add(string name, IRange changingCells, List<object> values = null, string comment = null, bool locked = true, bool hidden = false)
Parameters
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.

Returns
Type Description
IScenario

Returns the new IScenario object.