Using Macros with @RISK – Fixing Samples

One the most important features of @RISK is the ability to embed Excel macros within the simulation. That is, for a macro the be run at every iteration of a simulation. If one has a model that requires a macro to be run whenever the model’s input values are changed, then this functionality will be needed if simulation is to be run. 

The key point is that @RISK has the “Fixed Samples” functionality. This fixed the distribution sampling whilst the macro is being run. Without this functionality, in general, the results produced would be non-sensical. Generally, the various process steps within a macro could cause Excel to recalculate as the macro is running. If such recalculations were to cause the distributions to be resampled during the macro run, the results would be spurious: the macro is supposed to be full run each time the distributions have been sampled, so that the distributions should not be resampled during the run. The Settings to do so are shown on the @RISK Setting dialog in the image above.

I’ll will immodestly take credit for suggesting this feature to Palisade several years ago. It is one of the few features that are not in other competing products (such as ModelRisk) at this time, at least to my knowledge, yet is really fundamental to have for most applications that need macros. (The feature to fixed the samples is not needed if macros are only run before or after a simulation).