HomeTechniques and TipsVBA Programming with @RISKAutomating @RISK Simulations in VBA

10.5. Automating @RISK Simulations in VBA

Applies to: @RISK 6.x/7.x, Professional and Industrial Editions
(@RISK Standard Edition does not support automation.)

How can I write Visual Basic for Applications code to automate several independent simulations? I want to simulate the files one at a time, not all at once.

This is easy to do with the @RISK and Excel object models. Just open the first workbook, call Risk.Simulation.Start, and close the workbook.  An example is attached. It is set up for @RISK 7.x, but you can change the references in the Visual Basic Editor and run it in @RISK 6.x as well.

The Automation Guide that was introduced in 6.2.0 is a good introduction to automating @RISK with VBA. but it's not intended to document the complete object model. For methods and properties not mentioned in the Automation Guide, consult the XDK Reference, which is also found in the @RISK help menu.

Last edited: 2015-12-18

Downloads

This page was: Helpful | Not Helpful