13 Replies Latest reply: Feb 7, 2014 8:33 AM by ioannis giakoumakis RSS

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

    ioannis giakoumakis

      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")


      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
      End Select



      End Sub