Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

API in VB

HI

Can anyone advise how to make selections using API via VB? 

To date I have the below to open a file, refresh it, select the LIstbox i want to make the selection in but i cant get the IArrayOfRect Add methdo to work??  I can get it to Select all but i would like to eb able to specify a single select.

       

Dim QvApp As New QlikView.Application

     

Dim QVDoc As New QlikView.Document

QVDoc = QvApp.OpenDoc("C:\pgrp.qvw")

QVDoc.ReloadEx()


Dim sel As QlikView.ListBox

sel = QVDoc.GetSheetObject("LB02")

Dim pband As QlikView.IArrayOfRect

pband.Add("M")

sel.GeneralSelect(pband)

sel.SendToExcel()


QVDoc.CloseDoc()


QvApp.Quit()

Cheers

Mark

1 Solution

Accepted Solutions
m_woolf
Master II
Master II

LB02 is not a field. Replace the LB02 with the fieldname that is displayed in the listbox

View solution in original post

4 Replies
m_woolf
Master II
Master II

What field is displayed in the listbox?

To select in a field:

Activedocument.fields("Fieldname").Select "M*"

In the API Guide you might also lookup ToggleSelect and SelectExcluded

Not applicable
Author

Thanks for reply

I tried ...

QVDoc.Fields("LB02").Select("M*")

but i get an error stating that the object referenece is not set to an instance of an object

m_woolf
Master II
Master II

LB02 is not a field. Replace the LB02 with the fieldname that is displayed in the listbox

Not applicable
Author

thats it, so simple

I assumed it would use the ID, guess it is one of the read the def 'fieldname' !!

cheers