Macros and Automation
The QlikView Automation Interface
QlikView is equipped with an Automation interface (Automation was previously known as OLE Automation). This interface allows an external program or internal macro to access and control the QlikView application.
The complete specification of the QlikView Automation interface can be found in the folder Documentation of your QlikView application.
The Automation interface is an integral part of QlikView and you do not have to perform any special tasks to activate it.
How Automation and Macros Can Control QlikView
External Control of QlikView
QlikView objects are accessible by means of Automation from external programs, e.g. programs written in Visual Basic or C++ supporting Automation.
Such code can be used to control QlikView from other applications or from stand-alone programs.
Stand-alone executable files can be invoked from a QlikView document by means of launch buttons.
Internal Macro Interpreter
QlikView objects are also accessible via Automation from inside QlikView by means of the built-in macro interpreter.
Macros written in VBScript or JScript inside a QlikView document can currently be invoked in several ways:
Document events:
- A macro can be run after opening a QlikView document.
- A macro can be run after script re-execution.
- A macro can be run after the Reduce Data command.
- A macro can be run after a selection in any field in the document.
Sheet events:
- A macro can be run after a sheet is activated.
- A macro can be run when a sheet is deactivated.
Sheet object events:
- A macro can be run after a sheet object is activated.
- A macro can be run when a sheet object is deactivated.
Button events:
- A button sheet object can be linked to a macro.
Field events:
- A macro can be run after a selection has been made in a specified field.
- A macro can be run when a selection is made in any field logically associated with a specified field.
- A macro can be run when selections are locked in a specified field.
- A macro can be run when selections are unlocked in a specified field.
Variable events:
- A macro can be run after a value has been entered in a specified variable.
- A macro can be run when the value of a specified variable containing a formula has been changed due to a change in the formula value.