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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

macro?

Hi

i have a req like

if i selected project -sales  then store it in  C drive

if i select any other project then store it in  E drive

for this

i have created variable for   c path location and e pathlocation

c path location variable name is    vnewdev

e path location variable is   volddev

and   getfieldselections(project)   -   variable name is  vproject

here my macro is

set vpro=activedocument.variables("vproject")

if  vpro = "sales"

then

set dev=activedocument.variables("vnewdev")

else

set dev=activedocument.variables("volddev")

end if

i wrote like this but  still it is showing syntax error

why ?  what is the wrong here?


Labels (1)
1 Reply
patroser
Partner - Creator
Partner - Creator

Hi

you just set the variable to vpro.

You further need to check the Content of the variable.

Therefore try this:

sub Test

  set vpro = ActiveDocument.Variables("vProject")

  if  vpro.GetContent.String = "sales" then

       msgbox("Location C")

  else

       msgbox("Location E")

  end if

end sub

Best regards,

Patrick