CB.MacroResultDetail

This function returns detailed information about whether other Crystal Ball macro calls worked correctly and can include additional information for compatibility and diagnostic purposes.

Table 147. CB.MacroResultDetail Returned Data Type

Returned Value

Returned Data Type

The value of the specified property of CBMacroResultDetail as indicated in Table 148, CB.MacroResultDetail Properties

Variant

CB.MacroResultDetail is different from other Developer Kit subroutines and functions because its parameters are properties of a type class instead of constants. See the example for appropriate syntax.

Table 148. CB.MacroResultDetail Properties

Property

VBA Data Type

Description

OldValue

Integer

The value returned by CB.MacroResult, listed in Table 149

NewValue

Integer

The value returned by CB.MacroResultDetail.NewValue in this version of Crystal Ball

Msg

String

A string that summarizes the error

MsgDetails

String

A message with more information about the error

MsgTitle

String

The command for which these results are returned

DialogResult

String

Non-localized strings describing the actions in a dialog: "Yes," "No," "OK," "Cancel," and "None." "None" indicates that no dialog appeared

ElapsedTimeInMS

Long

The time in milliseconds required to process the command

To see a list of the named constants and values returned by CB.MacroResultDetail.NewValue, open Crystal Ball online help and find Crystal Ball Error Messages in the Contents. In VBA subroutines and functions, you can check the returned value against either the named constants or values.

Table 149. Values Returned by CB.MacroResult or CB.MacroResultDetail.OldValue

Returned Constant

Returned Value

Description

cbErrNone

0

The previous Crystal Ball command worked perfectly

cbErrBadValue

-1

A parameter had the wrong value

cbErrNoForecastInCell

-2

The command required a forecast cell to be active; the active cell did not contain a forecast

cbErrNotReady

-4

Crystal Ball has not yet run a simulation so the requested macro cannot be run

cbErrNoAssumptionInCell

-5

The command required one or two assumption cells to be selected. One or more selected cells did not contain assumptions.

cbErrBadSelector

-6

A parameter that was restricted to a small number of integers had a bad value

cbErrBadCommand

-7

The parm_number parameter had a bad value

cbErrUnsavedSheet

-8

The operation required all worksheets to be saved but one or more sheets were not saved

cbErrNoCBSheets

-9

There were no worksheets with Crystal Ball information to save

cbErrRestoreResult

-10

Restore Results failed

cbErrTooManyAssumptions

-11

Crystal Ball can store no more assumptions

cbErrTooManyForecasts

-12

Crystal Ball can store no more forecasts

cbErrBadCorrelation

-13

One or more correlations were invalid

cbErrBadAssumption

-14

One or more assumption parameters were invalid

cbErrUnexpected

-101

An unexpected error occurred, such as a formula cell was used for a macro that required a single-value cell