HomeTechniques and TipsVBA Programming with @RISK@RISK 4.5 VBA Macro Compatibility with 6.x/7.x

10.16. @RISK 4.5 VBA Macro Compatibility with 6.x/7.x

Applies to: @RISK for Excel 4.5, upgrading to @RISK 6.x Professional or Industrial Edition.
(@RISK Standard does not support automation.)
For compatibility of other releases, see Upgrading Palisade Software.

I wrote some macros to control my model in @RISK 4.5.  Will they work in @RISK 6.x/7.x?

Macros that are called by @RISK (listed on the Macros tab of the Simulation Settings dialog) will probably be fine. But macros that call @RISK may need to be rewritten. The good news is that you get many new capabilities, notably a much richer set of methods to produce customized graphs.

The macro language in changed substantially when @RISK 5.0 was released in late 2007. The 4.5 interface was largely oriented toward stand-alone functions, but the current interface is much more object oriented. Because the overall architecture changed, the current VBA interface does not contain a one-to-one replacement for some of the functions from the 4.5 interface. This means, unfortunately, that some macros written for 4.5, such as macros that run fits and simulations, must be modified for @RISK 6.x/7.x. You will have to analyze the logic of those macros and rewrite them for the new object model. This cannot be done mechanically by any sort of automatic conversion program. It was a difficult decision to make changes that would invalidate existing VBA macros, and we do understand and regret the inconvenience. But on balance we felt that the new object model offers so many advantages that the change was justified.

In Visual Basic Editor, you will need to remove the references to @RISK 4.5 and select references to the new version. Please see Setting References in Visual Basic for the appropriate references and how to set them.

Some help is available. Beginning with release 6.2, Automation Guides are included with the Professional and Industrial Editions of @RISK, Evolver, NeuralTools, and PrecisionTree. The Automation Guides introduce you to VBA programming in general and automating Palisade software in particular. To access an Automation Guide, click Help » Developer Kit (XDK) » Automation Guide. In addition to the Automation Guide, the same menu lets you access the XDK reference, with the complete object model and all methods and properties.

Last edited: 2015-06-18

This page was: Helpful | Not Helpful