Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
countnazgul
Contributor III
Contributor III

QlikView vbs open doc in new window

Hi all,

I'm writing a small vbs script that opens a qvw without data and saves it in different location. After the save is complete the document is closed. The problem is that if the main doc is already open QV closes it at the end. Is there a way the vbs script to open new QV instance instead using the already open one?

My "script.vbs" looks like this:

Set MyApp = CreateObject("QlikTech.QlikView")

set MyDoc = MyApp.OpenDocEx ( "c:\test\test.qvw", 2 , false , "" , "", "" , true)

MyDoc.SaveAs("c:\test_nodata\test.qvw")

MyDoc.CloseDoc

MyApp.Quit

Regards!

Stefan

2 Replies
Gysbert_Wassenaar

I don't think so, but you could leave out the MyApp.Quit line. If your script finishes then all object references should be cleaned up anyway automatically.


talk is cheap, supply exceeds demand
marcus_sommer

To do this you would need to start a new instance of qlikview - maybe in this way:

rem ** Example 1 ** from APIGuide.qvw

set app= ActiveDocument.GetApplication

app.Launch "C:\Program Files\Qv.exe","C:\Myfiles\abc.qvw"

and your code might be executed by an OnOpen-trigger or you execute external batches - triggerred per vbs or a load-statement:

QlikView Maven: QlikView Command Line and Automation

Re: create external task on QMC (VB)

- Marcus