CB.Simulation

This subroutine runs a Crystal Ball simulation on any open workbooks with Crystal Ball data for a specified number of trials.

Note:

The hide and minimize options are useful for increasing the speed of simulations.

Caution!

Note that Crystal Ball cannot run a simulation if a cell with Crystal Ball data is located in a write-protected worksheet. If you run a simulation using CB.Simulation without resetting, Crystal Ball runs additional trials and adds the results to the existing results. This means you can run more trials than the maximum set with the Run Preferences dialog or a Developer Kit macro call.

Table 187. CB.Simulation Parameters

Parameter

VBA Data Type

Value

Description

Iterations

Long

Any positive integer

Specifies the number of trials to run. If you already ran a simulation and did not reset it, Crystal Ball runs this many more trials.

Obsolete_Asynchronous (Optional)

Variant

null

Used as a placeholder for the Asynchronous parameter, removed starting with Crystal Ball 11.1.1.0.00.

HideForecasts (Optional)

Variant

True or False

Sets whether to suppress forecast windows from opening normally during simulations (True) or to let them open as set in each forecast (False). Suppressing forecast windows can help speed up long simulations.

MinimizeHost (Optional)

Variant

True or False

Sets whether to minimize Microsoft Excel during simulations (True) or not (False). Minimizing Microsoft Excel can help speed up long simulations. This parameter only works in Normal or Demo speed, not Extreme speed.

MinimizeAllSheets (Optional)

Variant

True or False

Sets whether to minimize worksheets during simulations (True) or not (False). Minimizing worksheets can help speed up long simulations. This parameter only works in Normal or Demo speed, not Extreme speed.

StatusString (Optional)

Variant

Words surrounded by quotes ("")

Inserts a string into the status bar during the simulation. If this is omitted, no special string appears.

ShowControlPanel (Optional)

Boolean

True or False

Sets whether to show the Crystal Ball Control Panel during simulations (True) or not (False). Hiding it can help speed up long simulations. The default is False for simulations run through the Crystal Ball Developer Kit. This parameter is new for Crystal Ball versions later than 5.5.