Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to run a sub in VBscript

For a try, I wrote this routine in VBScript

sub cleanUp()

  defaultSelections()

  set revSheet = ActiveDocument.Sheets("Revenues Summary")

  set Pivot = revSheet.CreatePivotTable

  Pivot.addDimension "Portfolio"

end sub

How to run the sub so that the object is created in the "Revenues Summary" sheet ?

Is the syntax for adding dimension appropriate ? How can I add as a dimension a field of the document (Portfolio field) ?

How can I debug this piece of code ? Will it exit with no message if there is some syntax mistake ?

Is it at all possible to launch a script in the Personal Edition ?

Thanks

3 Replies
vgutkovsky
Master II
Master II

To run the sub, create either a button or a text object. Add an Action by going to the Action tab >> External >> Run Macro. Enter the name of the sub.

You can do a basic debug by pressing the "Check" button in the Edit Module dialog.

Regards,

Vlad

Not applicable
Author

Thanks, is it also possible in the Personal Edition (see my other post)

vgutkovsky
Master II
Master II

Yes, doesn't matter if it's personal edition or licensed.

Vlad