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

Announcements
Register by January 31 for $300 off your Qlik Connect pass: Register Now!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

ActiveDocument.GetCurrentSelections -> Selections converted to "7 of 34" when I select more...

I thought I was getting a string of selections but at some point, my selection get converted into a string something like "7 of 34" instead of the list of selections. Can I overide this? There must be some string limit the the object does not give you all the selections...

set x = ActiveDocument.GetCurrentSelections

s = x.Selections

v = x.VarId

for i = lbound(s) to ubound(s)

msgbox v(i)&" = "&s(i)

next





1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

So, this works for me. Instead of using GetCurrentSelections I use GetSheetObject and grab my list box. Here's the code snippet I adapted to fit this need.

set LB = ActiveDocument.GetSheetObject("LB02")

for i = lbound(boxvalues) to ubound(boxvalues)

msgbox(boxvalues(i))

next

***Note that the above also only enumerates through selected list box members. I was not expecting this behaviour but am pleasantly surprised because that is exactly what I was trying to achieve.





View solution in original post

1 Reply
Anonymous
Not applicable
Author

So, this works for me. Instead of using GetCurrentSelections I use GetSheetObject and grab my list box. Here's the code snippet I adapted to fit this need.

set LB = ActiveDocument.GetSheetObject("LB02")

for i = lbound(boxvalues) to ubound(boxvalues)

msgbox(boxvalues(i))

next

***Note that the above also only enumerates through selected list box members. I was not expecting this behaviour but am pleasantly surprised because that is exactly what I was trying to achieve.