Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Qlikview Desktop 11.2 - Run a QVW inside another QVW

Hello People,

I want to re-load another QVW when I open my current QVW. To do it, I am using a Macro but I’ve some erros when execute it.

Imagine that my directory is XX

And my file is YY.

My code is the following:


sub Run_ETL



ActiveDocument.Reload



set App = ActiveDocument.GetApplication


set QVDocs=ActiveDocument.Fields
(XX).GetPossibleValues

for i = 0 To QVDocs.Count - 1

myDocName=QVDocs.Item(i).Text
ActiveDocument.Fields("
XX").Select(myDocName)

set FromDirectoryL=ActiveDocument.Fields("
XX").GetPossibleValues
FromDirectoryLoc=FromDirectoryL.Item(0).Text

ActiveDocument.Fields("
YY").Clear

Set Doc = App.OpenDoc(FromDirectoryLoc & myDocName )

Doc.Reload
Doc.Save

ActiveDocument.Activate
Doc.CloseDoc

Next


End Sub

What is wrong?

Thank you!

6 Replies
marcus_sommer

I use commonly to loop through tableboxes and it worked fine:

set obj = doc.GetSheetObject("TB01")
set newApp = ActiveDocument.GetApplication


for iRow = 1 to obj.GetRowCount - 1

     set app = obj.GetCell(iRow, 0)
     set path = obj.GetCell(iRow, 1)
     set newdoc = newApp.OpenDoc (path.Text & "\" & app.Text,"","")

     newdoc.reload

         newdoc.save
     newdoc.closedoc
next

- Marcus

Not applicable
Author

Thank you for your answer Marcus But what I'm looking is to run two QVW into one. I've one QVW to create the QVD from the Excel files and another QVW that use the QVDs to build the Dashboards. What I want is create a process which run both Script when I active the 2º QVW.

Current I'm using a batch file to run the first QVW. It works fine

(Another question ) But now I'm looking for a Macro to hide the Script Box like a page saying "Loading your Dashboard".

marcus_sommer

Within that tablebox you could have so many applications like you want and for running them in a certain order could you use the load-order from the data-table or you added an additionally sorting-field (is more flexible).

And I wouldn't use this kind of updating within an user-application - I would use this qvw as a control-app triggered per task to a certain time (probably overnight) and the user isn't involved with them.

- Marcus

Not applicable
Author

Thanks Marcus. I know that isn't a good pratice but I've to do it for an specific presentation

Do know that is possible to create the page that I'm saying while the execution time?

marcus_sommer

I think it will be rather not possible within one qvw (maybe within the easter egg settings but I don't believe it).

If you run it externally per batch with parameter /r or per vbs with createobject and then visible = false (logically it should work but there is no example within the APIGuide) you could run it in a hidden mode.

A workaround might be to use these progress-window itself as this message-box. I haven't tried it but it might work if you put your load-script in a hidden tab and showed some message within this window with the trace-statement.

- Marcus

Not applicable
Author

I'm using the following code in a macro:

Set WshShell = CreateObject("WScript.Shell")

ActiveDocument.WshShell.Run chr(34) & "C:\TESTE.bat" & Chr(34), 0

Set WshShell = Nothing

It's working fine I think I only have to guarantee that this macro runs first.