This subroutine defines which assumptions, decision variables, or forecasts will hold their worksheet values during a simulation.
Tip: | Before calling this subroutine, activate a worksheet and reset the simulation. You must have at least one assumption, decision variable, or forecast in the list of cells to freeze oe enable. Otherwise, CB.MacroResult returns an error. |
To freeze cells, build a list of cells to be “frozen” and then use the cbFrzSetList constant to actually freeze the list.
To unfreeze cells and freeze different ones, add all frozen cells to the list of frozen cells, unfreeze them, and then clear the list before freezing new cells.
It is not possible to select a range of cells in the format Range("D6:E527") and add that to the list of frozen cells. You must select and add each cell individually as shown in CB.FreezeND Example. To freeze a large number of cells, the most efficient way is to enumerate through all of the assumptions, decision variables, and forecasts on the sheet you wish to remove from the simulation and then freeze the Crystal Ball data in those cells one at a time. You should be able to refer to the example code for CB.EnumAssum, for example, to see how the enumeration should work. When you are done with the simulation, you will need to unfreeze the Crystal Ball data in the same way. |
Table 82. CB.FreezeND Parameters
See Table 83 for Index values | Defines which assumptions, decision variables, or forecasts should be frozen (hold to their worksheet values during a simulation). Values, listed in Table 83, are: 1 = cbFrzAddCell, 2 = cbFrzClearlist, 3 = cbFrzSetList. | ||
Sets whether the cells in the list (created by the Index parameter) are frozen during simulations (True) or enabled while all unlisted cells are frozen (False). The default is True. |
The following table shows named constant and index values for the Index parameter.
Table 83. CB.FreezeND Index Parameter Values — Required, Integer
Adds the selected cell to the list of frozen or enabled cells | ||
Clears the list of frozen or enabled cells added with cbFrzAddCell | ||
Depending on the value of the Frozen parameter, indicates that the listed cells are frozen (True) or the reverse, enabled (False). The default is False. This constant must be called after cbFrzAddCell to activate the freeze. (See CB.FreezeND Example, following.) |