Edit Module

Macros and custom defined functions can be written in VBScript or JScript using the Edit Module dialog. The module is saved with the document.

The following commands are available:

From the File menu the Export to Module File command lets you save the script as a file. There is also an option to Print the script.

The Edit menu contains a number of common options: Undo, Redo, Copy, Cut, Paste, Clear, Select All and Find/Replace. There is also an option: Insert File which permits you to import a previously saved Script File. Transform any text row in the script into a comment by means of the Comment command and switch it back again by using Uncomment.

(Macro Edit Box) The large edit box is where you type your macros. All macros should be written as sub-routines between a matching pair of sub .. end sub.
(List of entry points) As soon as an entry point is recognized by the scripting engine, it will appear in the list in the smaller, left text box. It is also possible to select entry points from this list.
(Message) The current state of any error messages is displayed in the box above the macro edit box.
Check Once you have a written sub, check and validate its syntax by pressing this button.
Goto Highlighting an entry point from the List of entry points and clicking Goto, takes you directly to its position in the Macro Edit Box.
Test With an entry point selected, you may test a macro by clicking the Test button. Any errors will appear in the Message box.
Scripting Engine Select between VBScript and JScript.
Requested Module Security By selecting Safe Mode the document designer indicates that the macros in this QlikView document contain no code that can access either the system or applications outside QlikView. If such code is encountered during macro execution in a document declared to be in Safe Mode, the execution will fail.
By selecting System Access mode the document designer ensures that the end user will be prompted when opening the document to either approve system access (Allow System Access), disable all macros in the document (Disable Macros) or allow only macros without system access (Safe Mode).
Current Local Security When opening a document declared to be in safe mode but containing potentially "unsafe" macro code, the user will be prompted (see Requested Module Security above). The user's action will be remembered by the system but this setting can be changed at a later time from this menu. Macro security level can be set to Don't Run at All, Only Safe Mode or Allow System Access.

Internal Macro Interpreter

Note: This is just a very brief introduction to the QlikView Scripting Engine. For a deeper understanding of VBScript or JScript you should refer to a handbook on the subject.