Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
giakoum
Partner - Master II
Partner - Master II

Open a document on the access point and make selections with vb script

Hi community.

I used the script provided by QlikTech to open a document, browse through objects and sheets, apply selections and close it again. This is used for precaching a document on the server so that the 1st user opens it quickly. It works fine if the document is opened by the desktop client.

Question :

Can it be done so that it opens on the access point instead of the desktop client? qvp call opens the file from the server but still it is opened in the desktop client (Like the open in server desktop functionality). I need to open it in the access point. Something like :

set doc = x.OpenDoc("c:\program files\internet explorer\iexplore.exe qvp://server/dashboard.qvw") but this does not work.

Script :

set x = CreateObject("QlikTech.QlikView")
set doc = x.OpenDoc("qvp://server/dashboard.qvw")

loop_through_objects(doc)
doc.CloseDoc
x.Quit

Sub loop_through_objects(doc)
For i = 0 to doc.NoOfSheets - 1

doc.ActivateSheet i
'Selection loop thru the field Region for example
Set val = doc.Fields("Region").GetOptionalValues
For y = 0 to val.Count - 1

INH = val.Item(y).Text
doc.Fields("Region").select INH
Objects = doc.ActiveSheet.GetSheetObjects
For j = lBound(Objects) to uBound(Objects)

set table = Objects(j)
select case Objects(j).GetObjectType
case 1,4,10,11,12,13,14,16,20,21,27
On Error Resume Next
CellRect = doc.GetApplication().GetEmptyRect()
CellRect.Top = 0
CellRect.Left = 0
CellRect.Width = table.GetColumnCount
CellRect.Height = table.GetRowCount
set CellMatrix = table.GetCells(CellRect)
For RowIter = 0 to CellMatrix.Count - 1
Next
End Select

Next

Next
doc.Fields("Region").clear

Next
End Sub

13 Replies
Peter_Cammaert
Partner - Champion III
Partner - Champion III

How about kicking the VBS-script on the server from a Supporting Task that is chained to the end of the Document Reload. Doh, requires a Publisher and a CAL for the service account.

Peter

marcus_sommer

I don't use the publisher which afaik is the only possibility to trigger external events/batches in a chain of reloads. Only with the server it isn't possible - it needs external schedules/triggers (perhaps windows scheduler) and external checks and error handling. You need always the proper access rights within the file-system and a CAL.

- Marcus

giakoum
Partner - Master II
Partner - Master II
Author

That would be my final solution if nothing else comes up. but I hate the idea of assigning a cal to the service account.

giakoum
Partner - Master II
Partner - Master II
Author

Hi Martin.

This looks promising. Not sure if I can install anything on the server but lets see.