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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
sushil353
Master II
Master II

need help to write a macro..

Hi All,

I want to write a macro to write an array of values in a list box.

suppose i have an array of values like

a(0)=123

a(1)=124

a(2)=125

a(3)=126

a(4)=127

then using a macro i want to create a listbox and write array values to listbox

Any advise or suggesstions

please help...

thanks

sushi

5 Replies
Not applicable

does it have to be through macro? would doing it in the load script work?

sushil353
Master II
Master II
Author

Hi Juan,

I have to use macro. because i am calculating the array using vb script.

Thanks

sushil

Not applicable

The problem is u can only add a field name to a list box, so your data should be in some field (i.e column) then only it can be represenred in a list box...

for example to add field class: 

set LB = ActiveDocument.ActiveSheet.CreateListBox

set BoxProp=LB.GetProperties

BoxProp.Def.Name = "Class"

LB.SetProperties BoxProp

to create a field, the script should be modified,

To add a new Line in script we have

rem ** add new line to script **

set docprop = ActiveDocument.GetProperties

docprop.Script = docprop.Script & "Load * from abc.csv;"

ActiveDocument.SetProperties docprop

try to add your array in script, give it a name and then include it in a listbox....

Regards,

Arun Goel

Not applicable

Hi Arun

I am also looking forward to add array to list box created by macros as you discribe it above, but i don't get it.

Help me out to fix this issue. At least how to add values to the  list box via macros

Not applicable

Hi Suahil

I am also looking forward to add array to list box created by macros as you discribe it above, but i don't get it.

please Help me out to fix this issue. At least how to add values to the  list box via macros