[]
Represents the collection of IScenario objects in the worksheet.
This interface provides access to the worksheet's What-If analysis scenarios. Use Scenarios to obtain the collection, then add, retrieve, and iterate through saved scenarios for the worksheet.
public interface IScenarios : IEnumerable
Public Interface IScenarios
Inherits IEnumerable
List<object> values = new List<object> { 0.05, 0.10, 0.15 };
IScenarios scenarios = worksheet.Scenarios;
scenarios.Add("Discount Plan", worksheet.Range["B1:B3"], values, "Quarterly discount rates", true, false);
foreach (IScenario scenario in scenarios)
{
string name = scenario.Name;
}
| Name | Description |
|---|---|
| Count | Returns the number of objects in the collection. This property returns the number of IScenario objects in the scenario collection for the current worksheet. |
| this[int] | Gets the scenario using the index. Use this property to retrieve a scenario from the worksheet's scenario collection by its position. |
| this[string] | Gets the scenario using the name. Name matching is case-insensitive. |
| Name | Description |
|---|---|
| Add(string, IRange, List<object>, string, bool, bool) | Creates a new scenario and adds it to the list of scenarios of the current worksheet.
The values in |