Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
LB02 is not a field. Replace the LB02 with the fieldname that is displayed in the listbox
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
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
LB02 is not a field. Replace the LB02 with the fieldname that is displayed in the listbox
thats it, so simple
I assumed it would use the ID, guess it is one of the read the def 'fieldname' !!
cheers