Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Is it possible to run the script from another document Qlikview without opening the document in question?
Thanks
Yes, you can do this with a macro. You can reference the 2nd QVW and use the Reload routine to run it's script. Alternatively, you can do it via bat using the /r switch, which open the documents, reloads it and then closes it. The macro method doesn't require the document to be opened at all, I believe.
Regards,
Please could you give me an example Sir VLAD.
Please an example using Macro Technic???
Haha "Sir Vlad," I like that 🙂 Sure, here is an example:
Sub ReloadQVW
Set docObj = ActiveDocument.GetApplication.OpenDocEx ("C:\Documents\myapplication.qvw",0) 'Open the document
docObj.Reload 'Reload the document
docObj.Save 'Save the document
docObj.CloseDoc 'Close the document
End Sub
I was mistaken before--this does open the document first. See the API Guide for more details. So in answer to your original question, I can think of only 1 way to reload a document without opening it. That is by using Publisher. You can also access the Publisher executable and reload via the script. See the QVS Reference Manual, page 241, for more details.
Regards,
Thank you Sir VLAD,
I'm very tired, i will try to execute this ROUTINE tomorow.
And i will make account.
Good Bye Sir VLAD
Good morning,
Please How is the macro is called in my Qlikview script ?
Thanks
Hi,
You can set the macros on the triggers...
Document Properties / Triggers and choose on "Document Event Triggers"
- OnOpen: Select this event to assign an action to be executed each time the QlikView document is opened.
- OnPostReload: Select this event to assign an action to be executed each time the script has been re-executed.
Click on Add Action: Add / External / Run Macro and put the name of your macro in the field.
You can put this macro in the script using the following syntax:
Sub ReloadQVW
Set docObj = ActiveDocument.GetApplication.OpenDocEx ("C:\Documents\myapplication.qvw",0)
docObj.Reload
docObj.Save
docObj.CloseDoc
End Sub
Call ReloadQVW