Macros Settings
The Macros settings tab (Figure 1 and 2, below) allows for the configuration to either run macros during a simulation or to run an Excel Tool during each iteration of a simulation. There are two layouts of the Macros tab, each with its own set of options - one for VBA Macros (Figure 1) and another for Excel Tools (Figure 2).
To switch between the two views of the Macros tab, select the appropriate option - 'VBA Macros' or 'Excel Tool'.
The options include:
VBA Macros
Figura 1 - Simulation Settings - Macros Tab, VBA Macros Settings
This option enables macros to be executed during an @RISK simulation, including options to run macros before, during, or after iterations and/or simulations. Running macros during a simulation allows for calculations that can only be performed through the use of macros, such as optimizations, iterative or "looping" calculations, or calculations that require data from an external source. Additionally, an Excel macro can includ other @RISK distribution functions that will be sampled during the execution of the macro.
The options include:
To run a macro during a simulation, check the box for step in which the macro should run. Enter the fully qualified name of the macro, including the full address with filename.
@RISK includes an object oriented Application Programming Interface (API) that allows custom applications to be built on top of @RISK functionality. For very complicated models, or those that either require or benefit from a high level of automation, the use of the @RISK API may be a better solution than using macros. See the @RISK Developer Kit (XDK) documentation for more information.
Excel Tool
Figura 2 - Simulation Settings - Macros Tab, Excel Tool Settings
This option enables a model to utilize an Excel tool such as Goal Seek or Evolver during each iteration of a simulation. Typically, an Excel Tool is used when the values sampled by @RISK should be used in a goal seek or optimization model. During each iteration, @RISK will run the selected tool and incorporate the calculated results from the tool into the simulation outputs.
Three Excel tools are available to call during a simulation:
The options in the lower half of the Macros tab will change based on the Excel Tool that is selected; Goal Seek has options that are configured through the Macros tab, whereas Evolver and Solver are both configured elsewhere.
The options available for Goal Seek are the same options as those set through the native Excel Goal Seek configuration: