Macro Event Behavior

When you have created your own function that is connected to an event (whether it be application-level or document-level) and the macro is running, the events within your function will execute before Statistica's default behavior; however, by default the application's default behavior will execute afterwards. For example, you have created a function that displays a message box telling the user that he/she may not save changes to a specific spreadsheet when he/she tries to save. By default this message box will be displayed, but then the save dialog will be displayed, allowing the user to save his/her changes. To disable Statistica's default behavior, include this expression at the bottom of the function's body:

Cancel = True

Conversely, either entering the expression:

Cancel = False

or not including a Cancel statement will run Statistica's default behavior after your function has ended.