Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
Peony
Contributor

Mistake in condition syntax VBS macro

Hi all.

There is some macro example. It should works on field click and send message foruser depending which value was selected. But instead of macro running I recive message "Macro parce failed. functionality was lost". What's wrong with it's  functionality?

sub notification

set vTOP = ActiveDocument.Fields("TOP").GetSelectedValues

if

$(vTOP) = 20

  then MsgBox "It's 20!"

  else MsgBox "Not 20"

end if

end sub

Tags (1)
1 Solution

Accepted Solutions
mwoolf
Honored Contributor II

Re: Mistake in condition syntax VBS macro

There is no dollar-sign expansion in VBS.

This is from the API Guide:

set val=ActiveDocument.Fields("Month").GetSelectedValues

for i=0 to val.Count-1

    msgbox(val.Item(i).Text)

next

View solution in original post

2 Replies
mwoolf
Honored Contributor II

Re: Mistake in condition syntax VBS macro

There is no dollar-sign expansion in VBS.

This is from the API Guide:

set val=ActiveDocument.Fields("Month").GetSelectedValues

for i=0 to val.Count-1

    msgbox(val.Item(i).Text)

next

View solution in original post

Peony
Contributor

Re: Mistake in condition syntax VBS macro

Thank you. It helps.