[]
Gets the scenario using the index.
Use this property to retrieve a scenario from the worksheet's scenario collection by its position.
IScenario this[int index] { get; }
ReadOnly Default Property Item(index As Integer) As IScenario
| Type | Name | Description |
|---|---|---|
| int | index | The zero-based index of the scenario in the collection. |
| Type | Description |
|---|---|
| IScenario | The scenario at the specified index. |
worksheet.Range["B2"].Value = 0.05;
worksheet.Range["B3"].Value = 0.08;
IRange range = worksheet.Range["B2:B3"];
worksheet.Scenarios.Add("Discount Plan", range);
IScenario scenario = worksheet.Scenarios[0];
Gets the scenario using the name.
Name matching is case-insensitive.
IScenario this[string name] { get; }
ReadOnly Default Property Item(name As String) As IScenario
| Type | Name | Description |
|---|---|---|
| string | name | The scenario name. |
| Type | Description |
|---|---|
| IScenario | The scenario with the specified name, or |
worksheet.Range["B2"].Value = 0.05;
worksheet.Range["B3"].Value = 0.08;
IRange range = worksheet.Range["B2:B3"];
worksheet.Scenarios.Add("Discount Plan", range);
IScenario scenario = worksheet.Scenarios["Discount Plan"];