Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sub in a macro

Hi, i Have a Sub in a Macro and i want to execute them as i reload my application.

well, i was searching and found the comand "call", i tried it but it's not working. I think that is cause is in a macro.

someone can help me?

Thank you.

7 Replies
tresesco
MVP
MVP

If your macro returns a value, you can call that in the script like:

Let vGetFromMacro = YourMacroName();

Remember, you can't access UI object from script.

Not applicable
Author

in my case, my sub don't return anything, but thank you 

i  have a sub that do a report and send a e-mail to some people. I have the sub script, but it's not working yet

sivarajs
Specialist II
Specialist II

Guess you cant directly call sub in qlikview script. You can define sub in function then you can call like above method

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Why not use a Document trigger called OnPostReload (see Settings->Document Properties->Triggers->Document Event Triggers)? That trigger will fire immediately after you do a document reload every time.

If you attach an action to this trigger like External->Run Macro and point that action to the macro Sub you already created, you get a more reliable result. Even works in a QVS environment.

See if that fits your requirements.

Best,

Peter

luciancotea
Specialist
Specialist

Peter, OnPostReload does not work in QVS.

The following triggers are not to be used in the QlikView Server environment, since they lack meaning or may cause unexpected results:

OnPostReduceData

OnPostReload

"QlikView reference manual"

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Oh great. Probably been working on OCX models for too long. And even there, triggers don't always work reliably it seems.

Thanks for the reminder.

Peter