Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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

1 Solution

Accepted Solutions
jagan
Luminary Alumni
Luminary Alumni

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.

View solution in original post

7 Replies
prabhuappu
Creator II
Creator II

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
Author

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

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

jagan
Luminary Alumni
Luminary Alumni

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.

Anonymous
Not applicable
Author

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!

jagan
Luminary Alumni
Luminary Alumni

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.

Anonymous
Not applicable
Author

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!

jagan
Luminary Alumni
Luminary Alumni

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.