Workbook Document-Level Events

The following table includes the document-level events that are available for workbooks:  

Command Action
Activate Executes when the workbook receives the focus within the Statistica workspace.
BeforeClose Executes when you close the workbook. Before the workbook closes, the events within this function will first execute. An example of using this feature would be to add additional functionality, such as saving the file to multiple locations or exporting it to another application.
BeforePrint Executes when you print the workbook. Before the workbook prints, the events within this function will first execute. Examples of using this feature would be to prevent users from printing the document or adding new functionality such as calling an alternate, customized printing dialog box.
BeforeRightClick Executes when you right-click anywhere on the workbook. Before the shortcut menu is displayed, the events within this function will first execute. An example of using this feature would be to add additional functionality to displaying shortcut menus, such as highlighting the entire contents of the workbook.
BeforeSave Executes when you save changes made to the workbook. Before the changes are actually saved, the events in this function will first execute. An example of using this feature would be to prevent users from permanently changing a workbook.
Deactivate Executes when the workbook has lost the focus to another window within Statistica.
OnClose Executes when the workbook is being closed.
Open Executes when the workbook is being opened. Note that this will not run unless autorun was specified when the macro was last edited.
SelectionChanged Executes when the focus within the workbook has moved.

For additional events, see Statistica Events, Application-Level Events, Graph Document-Level Events, Report Document-Level Events, and Spreadsheet Document-Level Events.

For examples, see Application-Level Events Example and Document-Level Events Example.