Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
goro2010
Creator
Creator

Call Macro from Script

Good Day,

I have this QVW that is calling a BAT document.

Script:

EXECUTE cmd.exe /C C:\QVD\MacroReload.bat;

EXIT SCRIPT;

BAT Script:

"c:\Program Files (x86)\qlikView\QV.exe" /VvReloadMacro=2 "C:\QVD\Test.qvw"

The idea is, that when the variable ReloadMacro is equal to two, then it should execute a Macro without clicking a button.

Is this possible?

Thank You

1 Solution

Accepted Solutions
goro2010
Creator
Creator
Author

Hi Guys,

I have managed to change it and get it working, Andrey gave me the right place to look at

What I have done..

I have created another Macro:

IF ReloadMacro = 2 THEN

  CALL ReloadMacro2

ETC......

And I have made the trigger on (OnOpen), and call ReloadMacro

11.PNG

Thank You!!!!

View solution in original post

10 Replies
ahaahaaha
Partner - Master
Partner - Master

Hi Jan,

May be it be through running a macro when changing a variable in a document's properties?

1.jpg

Regards,

Andrey

goro2010
Creator
Creator
Author

Hi Andrey,

This feels like the way I need to go, I have made the changes.

BAT file does change the variable, but the Macro did not fire?

Any suggestion why?

Thank You

tamilarasu
Champion
Champion

Hi Jan,

Could you explain us how are you changing the variable i.e vReloadMacro as 2? It would be easy for us to help you further.

goro2010
Creator
Creator
Author

Hi Tamil,

I am doing it via BAT Script.

The script opens the QVW and then set the variable to 2

BAT Script:

"c:\Program Files (x86)\qlikView\QV.exe" /VvReloadMacro=2 "C:\QVD\Test.qvw"

Thank You

tamilarasu
Champion
Champion

Jan,

I am not clear about your requirement. Do you want to run the macro in the same qvw file which calling the BAT file?  If possible, could you attach a small sample and explain us?

goro2010
Creator
Creator
Author

Hi Guys,

I have managed to change it and get it working, Andrey gave me the right place to look at

What I have done..

I have created another Macro:

IF ReloadMacro = 2 THEN

  CALL ReloadMacro2

ETC......

And I have made the trigger on (OnOpen), and call ReloadMacro

11.PNG

Thank You!!!!

tamilarasu
Champion
Champion

Great Jan!! Glad that you found the solution by yourself with all your effort. Sorry I could not help you out, since I was not sure what was your requirement. Have a good day!!  

goro2010
Creator
Creator
Author

Tamil,

The idea behind a community forum is not to be spoon fed everything

Just to be pointed in the correct direction and then to figure it out by yourself and to learn out of your mistakes

Thank You All!

tamilarasu
Champion
Champion

Ha ha. I completely agree with your point. BTW, I was not able to provide any valid point in this case .