Skip to main content Skip to complementary content

Visual Basic programming language

Visual Basic is a very suitable language for writing macros and other programs for controlling QlikView via its Automation interface. Such code could of course also be written in other programming languages supporting Automation, e.g. Visual C++, but for most users Visual Basic in one of its forms is likely to be the first choice. For this reason a few words about the language could be appropriate in this documentation.

Visual Basic is a programming language with roots in the old BASIC language, known to almost everyone, who has ever programmed a computer. In comparison with its ancestor Visual Basic however has a number of additions which make it a quite modern object oriented programming language. Visual Basic has during the last few years turned into a macro and scripting language widely used by major software producers. It was therefore a natural choice to use the language (in its VBScript incarnation) as the macro language for QlikView.

As already mentioned above this document is not intended as a manual for Visual Basic. The reader is supposed to possess a basic knowledge of Visual Basic programming. However, so many examples are provided, that it should be possible for most readers to produce simple macros even without further study of Visual Basic.

Differences between VB, VBA and VBS

Visual Basic as a stand alone compiler (VB), Visual Basic for Applications (VBA) and Visual Basic Script (VBS) are all variations of the Visual Basic language. Most of the basic syntax and keywords are the same, but small variations exist. When it comes to advanced capabilities and the ability to communicate with the outside world from the code, there are large differences, especially between VB/VBA on one side and VBS on the other.

This documentation has a number of examples in the form of small pieces of Visual Basic code. They come both from the VB and the VBS environment. Sometimes, but not always, there is a note indicating that the code works in one specific environment. The reader should be able to modify the code without a problem if a certain environment refuses to accept a certain syntax.

Main differences

Functionality differences
Functionality VB VBA VBS
Compile stand-alone .EXE yes no no
Full VB syntax yes yes no
Data types full full limited

Different versions of VBScript

Apart from the incomplete listing of differences below, additional differences may exist as a result of which version of VBScript you are using. QlikView is currently shipped with VBScript version 3.1.

Some VB features not included in VBScript

  • Clipboard access
  • Collection
  • Conditional compilation
  • Constants
  • Data types (only variant supported)
  • Date/Time
  • DDE
  • Debug commands
  • Financial

Some features with limited implementation in VBScript

  • Array handling
  • Error handling (only On Error Resume Next)
  • File input/output

Some VB keywords and functions not supported by VBScript

  • Declare
  • Dim … as <datatype>
  • DoEvents
  • For Each … Next
  • GoSub … Return
  • GoTo
  • Line Numbers
  • Line Labels
  • Like
  • New
  • With … End With

Parentheses around arguments notables

In VB, VBA and VBS the following rules apply to the use of parentheses around arguments:

  • Always use parentheses around parameters to properties.
  • Arguments to single parameter methods may optionally be enclosed in parentheses.
  • Arguments to multiple parameter methods must not be enclosed in parentheses.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!

Join the Analytics Modernization Program

Remove banner from view

Modernize without compromising your valuable QlikView apps with the Analytics Modernization Program. Click here for more information or reach out: ampquestions@qlik.com