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

Set Predefined Values in Drop-down with a macro?

Is is possible to set the Predefined Values in Drop-down with a macro?

1 Solution

Accepted Solutions
Anonymous
Not applicable

Did you try creating one variable with required proeperties set in the fron-end (one time)

then read propeties (using getproperties method) from this variable and apply it to all the variables that you are creating in your macro (using setproperties method)

View solution in original post

5 Replies
Anonymous
Not applicable

Why would you want to do that?

Looks like you are already populating the values in your variable dynamically.

OR

you creating a lot of variables on the fly and want to set the value list property for each them as 'predefined values in drop down' by writing a macro'?

m_woolf
Master II
Master II
Author

I am creating variables on the fly via a macro.

I have not been able to figure how to set the "Predefined Values in Drop-down" with the macro.

Maybe this can't be done, but I'm hoping for suggestions.

Anonymous
Not applicable

Did you try creating one variable with required proeperties set in the fron-end (one time)

then read propeties (using getproperties method) from this variable and apply it to all the variables that you are creating in your macro (using setproperties method)

m_woolf
Master II
Master II
Author

Reading the properties from one variable and then trying to set the same properties to another variable cause VBScript to error with -2147467259.

Thanks for the suggestion.

m_woolf
Master II
Master II
Author

It worked after I added the middle line. Thanks again.

set prop = ActiveDocument.Variables("var1").GetProperties

prop.Name = "var2"

ActiveDocument.Variables("var2").SetProperties prop