Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

assafmilman
New Contributor III

Reload QVW from command line doesn't trigger macro

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>"

  • Is this a matter of security permissions?
  • Are there any logs showing which macros where executed during reload?

Thanks!

Assaf

Tags (2)
1 Solution

Accepted Solutions
MVP
MVP

Re: Reload QVW from command line doesn't trigger macro

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.

7 Replies
prabhuappu
Contributor II

Re: Reload QVW from command line doesn't trigger macro

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

Not applicable

Re: Reload QVW from command line doesn't trigger macro

I hope u are using the similar command line as below.

"C:\Program Files\QlikView\qv.exe" /l "D:\QlikView\Applications\Application_Layer.qvw"

MVP
MVP

Re: Reload QVW from command line doesn't trigger macro

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.

assafmilman
New Contributor III

Re: Reload QVW from command line doesn't trigger macro

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!

MVP
MVP

Re: Reload QVW from command line doesn't trigger macro

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.

assafmilman
New Contributor III

Re: Reload QVW from command line doesn't trigger macro

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!

MVP
MVP

Re: Reload QVW from command line doesn't trigger macro

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.