Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

VBScript OpenDoc works inconsistently

I have a simple VBScript written as follows. This is called from windows command prompt using
command :  cscript -nologo mytest.vbs

The mytest.vbs itself is simple as:

----- Start of mytest.vbs -------

Dim qvwFile, objQV, docObj2

WScript.Stdout.Write " Enter QVW File Path: "

qvwFile = Wscript.StdIn.ReadLine

Set objQV = CreateObject("QlikTech.QlikView")

Wscript.Sleep 2000

Wscript.Echo ("Opening qvwFile: " & Chr(34) & qvwFile & Chr(34))

Set docObj2 = objQV.OpenDoc(Chr(34) & qvwFile & Chr(34))

Wscript.Sleep 2000

docObj2.Save

docObj2.CloseDoc

objQV.Quit

------ End of mytest.vbs --------------

When run, gives error "mytest.vbs - Microsoft VBSCript runtime error: Object Required" at the line "docObj2.Save" .

If I log off and log back in, it works. I noticed that if for some reason previous run of the script was unfinished or unsuccessful, it leaves something in memory that prohibits next run of this script to run successfully.

Anyone else have similar experience? If so, what is cleaner solution?

Thanks