Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone,
thanks for all your solutions and good topics of this community.
I have a issue with automating the reloading of qvw with vbs. Indeed, I would like to reload a bunch of apps with a batch script.
Thus, I first used the qv.exe command line with /r and /l arguments but I faced an issue with the progress window that does not automatically close.
So I then found the vbs solution, using the opendocex function which allow a "progress mode" and avoid this progress window. This nicely works, except that I can not find out how to pass parameters to this method (same as /v argument with the qv.exe command line).
I searched my friend google but have not found out the answer. Any idea ?
Thanks by advance for you help.
Romain
This worked:
Option Explicit
Dim QA, QD, apppath, param1, newdoc
apppath = "C:\test.qvw"
param1 = inputBox("param: ")
set QA = CreateObject("QlikTech.QlikView")
set QD = QA.ActiveDocument.GetApplication
set newdoc = QD.OpenDoc(apppath, "","")
newdoc.Variables("matable").SetContent param1, true
newdoc.ReloadEx 0,1
newdoc.save
newdoc.CloseDoc
QD.Quit
- Marcus
1 - Using Publisher
In QlikView QMC-> Users-> Supporting Tasks-> External commands. You could run external commands and pass parameters the same way you schedule a Windows Scheduled task.
2 - ShellExecute command :
- Make sure that you have checked on 'close when finished' on Script Execution Progress window.
- Also you could use window paramter to hide QV to be displayed while reloading , Example : http://ss64.com/vb/shellexecute.html
I hope this helps!
MultiView
You could the apps treat as object and set hereby any variables you want:
set App = ActiveDocument.GetApplication
set newdoc = App.OpenDoc (Path & Area & arr(i_app),"","")
newdoc.Variables("text_update").SetContent M_all, true
- Marcus
Thank you Multiview and Marcus.
I tried the "object" solution, but unfortunately I got an error :
"Required Object: 'Variables(...)'"
?
oO
Your variable is already exists in the called app? Perhaps there is a little error in the syntax ... post your code.
- Marcus
Thank you very much for your assistance Marcus.
This is my code:
Option Explicit
Dim QA, QD, apppath, param1
apppath = "C:\test.qvw"
param1 = inputBox("param: ")
set QA = CreateObject("QlikTech.QlikView")
set newdoc = QA.OpenDoc(apppath, "","")
newdoc.Variables("matable").SetContent param1, true
QD.ReloadEx 0,1
QD.save
QD.CloseDoc
QA.Quit
Note that the variable "matable" is declared in my QVW.
This worked:
Option Explicit
Dim QA, QD, apppath, param1, newdoc
apppath = "C:\test.qvw"
param1 = inputBox("param: ")
set QA = CreateObject("QlikTech.QlikView")
set QD = QA.ActiveDocument.GetApplication
set newdoc = QD.OpenDoc(apppath, "","")
newdoc.Variables("matable").SetContent param1, true
newdoc.ReloadEx 0,1
newdoc.save
newdoc.CloseDoc
QD.Quit
- Marcus
Got it working! Thanks Marcus.