If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.
Hi all,
In my QV project I created a VB macro which is triggered right after reload completes.
My problem is that when I reload the QVW via command line, the macro doesn't seem to start.
When reloading manually with ctrl-R in QV, the macro runs.
I'm using this command line - "<Path_to_qv.exe> /r <path_to_QVW>"
Thanks!
Assaf
Hi,
Put this two statements at the end of the macro
ActiveDocument.Save
ActiveDocument.GetApplication.Quit
This will save the Qlikview file and closes the document.
Regards,
Jagan.
Hi,
What kind of operation you are trying to perform using macro?
Are you running the cmd line script using task scheduler or Directly from cmd prompt?
Please check whether you have enabled below options
"Current Local Security Allow System Access" and "Requested Module Security - System Access"
Add msgbox("Alert") code in between your code to check whether the problem is with running the macro or some kind of code issue.
Regards,
Prabhu Appu
I hope u are using the similar command line as below.
"C:\Program Files\QlikView\qv.exe" /l "D:\QlikView\Applications\Application_Layer.qvw"
Hi,
Try /NoSecurity option. Before that add a message box to make sure that macro is triggering or issue with the macro.
"C:\Program Files\QlikView\qv.exe" /l /NoSecurity "D:\QlikView\Applications\Application_Layer.qvw"
Regards,
Jagan.
When I use /l /NoSecurity it does work, but since this is QV document is found on the QV server, I need to save and close it after reload so all my users see the changes.
I tried using /r /NoSecurity but that did not help either.
Any idea what else can be done?
Thank you!
Hi,
Put this two statements at the end of the macro
ActiveDocument.Save
ActiveDocument.GetApplication.Quit
This will save the Qlikview file and closes the document.
Regards,
Jagan.
Your solution nailed it.
Now my command line is "/l /NoSecurity" and my macro has
ActiveDocument.Save
ActiveDocument.GetApplication.Quit
I don't understand why plain "/r /NoSecurity" did not do the job, but your solution works.
Thanks!
Hi,
In command prompt you have to give /NoSecurity option to override the security. After executing macro in command prompt qv file won't close automatically, to overcome this we need to use below lines
ActiveDocument.Save
ActiveDocument.GetApplication.Quit
Regards,
Jagan.