Macros Tab

Figure 1 - Optimization Settings - Runtime Tab

VBA macros can be run at different times during an optimization and/or during each trial solution. This allows custom calculations to be invoked during an optimization. Check the box to the left of an option to enable it, and provide the name of the macro to be executed at that point of analysis.

This feature allows for calculations - that can only be performed through the use of a macro - to be made during an optimization. Examples of such macro-performed calculations are iterative looping calculations and calculations that require new data from external sources.

Macros can be executed at the following times during an optimization:

  • At the Start of the Optimization - The specified macro runs after the Start button is clicked, prior to the first trial solution being generated.
  • Before Recalculation of Each Trial - The specified macro runs before recalculation of each trial that is executed.
  • After Recalculation of Each Trial - The specified macro runs after recalculation of each trial that is executed.
  • After Storing Output - The specified macro runs after each trial that is executed and after the target cell’s value is stored in the optimization engine.
  • Any changes made to cell values will have no effect on the information passed to the optimization engine on that trial. This option can be used to update on optimization progress (or to log optimization progress)!

  • At the End of the Optimization - The specified macro runs when the optimization is completed.