CB.RunPrefsND

This subroutine sets preferences corresponding to the Run Preferences dialog. Any run preferences not explicitly defined default to the current setting in the Run Preferences dialog.

See the Oracle Crystal Ball User's Guide for more information on setting run preferences.

Table 152. CB.RunPrefsND Parameters

Parameter

VBA Data Type

Value

Description

Index

Integer

See Table 153

Works with the Value1 and Value2 parameters to set Crystal Ball run preferences

Value1

Variant

See Table 154

Works with the Index parameter to set Crystal Ball run preferences

Value2 (Optional)

Variant

Any positive whole number

For Index = 4, cbRunSameRandoms: Long — Sets the initial seed value for the random number generator

The following Index named constant and index values (Table 153) work with the Value1 and Value2 parameters to set Crystal Ball run preferences.

Table 153. CB.RunPrefsND Index Parameter Values — Required, Integer

Named Constant Value

Index Value

Description

cbRunMaxTrials

1

Sets the maximum number of trials to the number in Value1

cbRunStopOnError

2

Sets whether the simulation stops on calculation errors in forecast cells, according to Value1

cbRunSameRandoms

4

Sets whether the random number generator uses the same sequence of random numbers (Value1) and sets the initial seed value (Value2)

cbRunSamplingMethod

7

Selects whether to use the Latin Hypercube or Monte Carlo sampling method, according to Value1

cbRunSampleSize

8

Sets the Latin Hypercube sampling method’s sample size to Value1

cbRunCorrelationsOff

10

Sets whether to turn off correlations, according to Value1

cbRunMinimizeHost

26

Sets whether to minimize Microsoft Excel during simulations, according to Value1.

Note:

This constant only applies in Normal and Demo speeds; it does not apply in Extreme speed.

cbRunMinimizeSheets

27

Sets whether to minimize worksheets during simulations, according to Value1.

Note:

This constant only applies in Normal and Demo speeds; it does not apply in Extreme speed.

cbRunHideForecasts

28

Sets whether to suppress forecast and assumption windows during simulations (as well as overlay, trend, and sensitivity charts), according to Value1

cbRunMode

29

Sets whether to run in Extreme, Normal, or Demo speed, according to Value1; note that Extreme speed requires an Crystal Ball Decision Optimizer license

cbRunRandomSeed

31

Specifies the initial random seed value, according to Value1

cbRunPrecisionControl

40

Sets whether to stop a simulation when the forecast precision reaches a set confidence level; only takes effect after a reset

cbRunPrecisionConfidence

46

Sets the confidence level for precision control to Value1

cbRunReversePercentiles

47

Changes the interpretation of percentiles, according to Value1

cbRunFormatPercentiles

48

Indicates how to format percentiles, according to Value1

cbRunSaveAssumptionValues

49

Indicates whether to store assumption values for later analysis (such as sensitivity analysis) according to Value1

cbRunLeaveOpenOnReset

50

Sets whether to leave the Crystal Ball Control Panel open when a simulation is reset, according to Value1

cbRunUserMacros

51

Specifies whether or not to run user-defined macros, according to Value1

cbRunCapMetrics

52

Sets whether the UI should display capability metric related information, according to Value1

cbRunCapMetricsShort

53

Determines if the underlying forecast data should be considered short or long term, according to Value1

cbRunCapMetricsShift

54

Sets the shift value used for calculating Zst and Zlt, according to Value1

cbRunCapMetricsCalcType

55

Determines if the metrics should be calculated from the fitted curve or the data, according to Value1

cbRunCapMetricsNormalityThresh

56

Specifies the p-value threshold used for normality testing, according to Value1

cbRunCapMetricsNormalCalcOptions

57

Specifies whether to calculate the data from the fitted curve or the data if the forecast values are not normal, according to Value1; only valid if cbRunCapMetricsCalcType = 0

cbRunAlertLevel

62

Specifies which Crystal Ball alert messages to show according to Value1; optionally, clears all Do Not Show Again preferences to default values if Value2 = True (Value2 default = False)

Note:

The following Index constants used in Crystal Ball 2000.5 (5.5) are now obsolete: cbRunBurstMode = 5, cbRunResetToOriginal = 6, cbRunSensitivAnalysis = 9, cbRunRetainUnsortedTrials = 11, cbRunMacroBeforeSimul = 21, cbRunMacroBeforeRecalc = 22, cbRunMacroAfterRecalc = 23, cbRunMacroAfterSimul = 24, cbRunParadiseServer = 30, cbRunBurstAmount = 33, cbRunPrecisionWithin = 45. cbRunPrecisionMean = 41, used in versions before Crystal Ball 2000.5 (5.5), is now obsolete. In Crystal Ball 2000.5 (5.5), values for cbRunMode [29] were boolean; in later versions of Crystal Ball, the values are Integer. Models from Crystal Ball 2000.5 (5.5) that use this constant will not run successfully in later versions of Crystal Ball until the constant values are edited.

The following Value1 values (Table 154) are used with the Index parameter to set Crystal Ball run preferences.

Table 154. CB.RunPrefsND Value1 Parameter Values — Required, Variant

Used With Specified Values of Index

Value

Description

For Index = 1, cbRunMaxTrials: Long

Any positive whole number

Sets the maximum number of trials

For Index = 2, cbRunStopOnError: Boolean

True or False

True stops a simulation on calculation errors in forecast cells. False does not.

For Index = 4, cbRunSameRandoms: Boolean

True or False

True uses the same sequence of random numbers. False does not.

For Index = 7, cbRunSamplingMethod: Boolean

True or False OR cbSamLatinCube = True; or cbSamMonteCarlo = False

True uses Latin Hypercube. False uses Monte Carlo.

For Index = 8, cbRunSampleSize: Integer

A whole number between 10 and 5000

Sets the sample size for Latin Hypercube sampling

For Index = 10, cbRunCorrelationsOff: Boolean

True or False

True turns off correlations. False turns on correlations.

For Index = 26, cbRunMinimizeHost: Boolean

True or False

True minimizes Microsoft Excel during simulations. False does not.

For Index = 27, cbRunMinimizeSheets: Boolean

True or False

False minimizes worksheets during simulations. True does not.

For Index = 28, cbRunHideForecasts: Boolean

True or False

True suppresses forecast and all other chart windows during simulations. False does not.

For Index = 29, cbRunMode: Integer

cbRunExtremeSpeed = 1, cbRunNormalSpeed = 2, cbRunDemoSpeed = 3

Sets Crystal Ball to run in Extreme speed (if available), Normal speed, or Demo speed depending on the named constant or index value listed in the Value column

For Index = 31, cbRunRandomSeed: Long

Any positive whole number

Sets the seed value for using the same random sequence of numbers

For Index = 40, cbRunPrecisionControl: Boolean

True or False

True uses precision control to stop the simulation. False uses the maximum number of trials.

For Index = 46, cbRunPrecision Confidence: Double

Any value between 0.01 and 99.99

Setting for cbRunPrecisionConfidence; sets the confidence level (as a percentage) for precision control

For Index = 47, cbRunReversePercentiles: Boolean

True or False

True makes percentiles represent the percentage of the distribution greater than the percentile value. False makes percentiles represent the percentage less than the value.

For Index = 48, cbRunFormatPercentiles: Boolean

True or False

Determines whether percentiles are indicated by a percent sign (10%) or by a P before the value (P10); True uses the P and False uses the % sign.

For Index = 49, cbRunSaveAssumptionValues: Boolean

True or False

True saves assumption values for later analysis (such as sensitivity analysis). False discards them.

For Index = 50, cbRunLeaveOpenOnReset: Boolean

True or False

True leaves the CB Control Panel open when a simulation is reset. False closes it.

For Index = 51, cbRunUserMacros: Boolean

True or False

Indicates whether or not to run user-defined macros; True runs them and False does not run them.

For Index = 52, cbRunCapMetrics: Boolean

True or False

Sets whether the UI should display capability metric related information; True shows metrics and False does not show capability metrics.

For Index = 53, cbRunCapMetricsShort: Boolean

True or False

Determines if the underlying forecast data should be considered short- or long-term; True = short-term data and False = long-term data.

For Index = 54, cbRunCapMetricsShift

A numeric value indicating short-term/long-term shift

Sets the shift value used for calculating Zst and Zlt; the default shift used in the UI is 1.5

For Index = 55, cbRunCapMetricsCalcType: Integer

0 or 1

Determines if the capability metrics should be calculated from the fitted curve or the data; 0 = calculate from fitted curve and 1 = calculate from data

For Index = 56, cbRunCapMetricsNormalityThresh: Double

Any positive value between 0 and 1

Specifies the p-value threshold used for normality testing

For Index = 57, cbRunCapMetricsNormalCalcOptions: Integer

0 or 1

Determines if the capability metrics should be calculated from the fitted curve or the data if the distribution is not normal; 0 = calculate from fitted curve and 1 = calculate from data

For Index = 62, cbRunAlertLevel: Integer

cbRunAlertShowAll = 0, cbRunAlertShowImportant = 1, cbRunAlertShowNone = 2

Sets Crystal Ball to show alert messages according to the named constant or index value listed in the Value column