Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
bluecarbon
Contributor

VB Script saving and closing Qlikview app

Hi,

Someone help me with VB script that can open a Qlikview Document and save it and close it without any alert message. I m trying to create -prj folder using vb macro.

Thanks,

Rakul.

Tags (2)
2 Replies
tmackay2015
New Contributor III

Re: VB Script saving and closing Qlikview app

try this:

Sub opennclose()

pth = "C:\Users\macka\Desktop\gyhijk.qvw"

Set qvdoc = application.OpenDocEx(pth, 1, 0)

Dim oFSO

Set oFSO = CreateObject("Scripting.FileSystemObject")

oFSO.CreateFolder Left(pth, Len(pth) - 4) & "-prj"

qvdoc.Save

qvdoc.CloseDoc

set oFSO = nothing

End Sub

you should be able to find out how to get a value into a macro elsewhere on the site so i won't go into that

Re: VB Script saving and closing Qlikview app

I use these loop-routine for various export- and print-jobs and it should work for your task, too.

sub AutomaticLoop

dim doc, obj, iRow, app, path, newApp, newdoc

set doc = ActiveDocument

set obj = doc.GetSheetObject("TB01") 'tablebox with apps and full-paths

for iRow = 1 to obj.GetRowCount - 1

    set app = obj.GetCell(iRow, 0) 'application

    set path = obj.GetCell(iRow, 1) 'path

    set newApp = ActiveDocument.GetApplication

    set newdoc = newApp.OpenDoc (path.Text & "\" & app.Text,"","")

    newdoc.GetApplication.WaitForIdle

    newdoc.closedoc

next

set obj = nothing

set app = nothing

set path = nothing

set newApp = nothing

set newdoc = nothing

doc.GetApplication.Quit

           

end sub   

- Marcus

Community Browser