Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Execute VB Function with parameter from a Button

Hi all,
i would like to run a VB function with parameters by click on a button.
The function is not running, can  someone help me?

The Action in my Button is: =SetVars('myVarName')
My VB Function is:

Function SetVars(s)
Set v = ActiveDocument.Variables(s & "_v")
  If v.GetContent.String = "1" Then
   v.SetContent "0", true
  Else
   v.SetContent "1", true
  End If
End Function

2 Replies
nagaiank
Specialist III
Specialist III

If the requirement is to toggle the variable value between 1 and 0, you may implement using a button with action. There is no need for a VB macro. An example is attached.

Not applicable
Author

Thats perfect!
Thanks!!!