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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Using GetSelectedCount in a macro

Hello

Can someone tell me what I'm doing wrong? I want to use GetSelectedCount in a macro but can't quite manage it. I can use it in an expression in a document without problem, but the macro solution is eluding me.

I've tried these two, neither of which work.

v=ActiveDocument.Fields("Field1").GetSelectedCount

v=ActiveDocument.GetSelectedCount("Field1")

For reference, the expression that works in a doc is: =GetSelectedCount([Field1])

With thanks

James

1 Solution

Accepted Solutions
Not applicable
Author

I think GetSelectedCount doesn't exist for macro's in QV but I believe what you are looking for is:

set v=ActiveDocument.Fields("Field1").GetSelectedValues

v.Count will return how many items you have selected.

Hope that helps!

View solution in original post

2 Replies
Not applicable
Author

I think GetSelectedCount doesn't exist for macro's in QV but I believe what you are looking for is:

set v=ActiveDocument.Fields("Field1").GetSelectedValues

v.Count will return how many items you have selected.

Hope that helps!

Not applicable
Author

Worked a treat. Thank you !!!