Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to transfer parameter from qlikview to Macro

I write a macro shows below.

sub test(varible)

msgbox varible

end sub

Now I want to transfer parameter from qlikview to macro. I create a qlikview button, and input macro name : test(hello). But when I click the button, no msgbox come out carry the hello word. Why? And what can i do next?

1 Solution

Accepted Solutions
pover
Luminary Alumni
Luminary Alumni

You cannot pass a variable in that way from a button to a macro. You should create a QlikView Variable that the macro can use, call just the macro "test" in the button and then in that macro recall the value of the QlikView variable. Something like the below example:

sub test

set v = ActiveDocument.Variables("Variable1")
msgbox(v.GetContent.String)

end sub

Regards.

View solution in original post

2 Replies
pover
Luminary Alumni
Luminary Alumni

You cannot pass a variable in that way from a button to a macro. You should create a QlikView Variable that the macro can use, call just the macro "test" in the button and then in that macro recall the value of the QlikView variable. Something like the below example:

sub test

set v = ActiveDocument.Variables("Variable1")
msgbox(v.GetContent.String)

end sub

Regards.

Not applicable
Author

Thank you very much.