Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

how to call macro in a loading script ?


hi,

Qlikview Document edit module,maro code:

sub kk

....

end sub

how to call macro in a loading script ? is it possible to execute a macro?

Thanks in advance & best regards

12 Replies
MVP
MVP

Re: how to call macro in a loading script ?

Try like:

LET vVar= kk();

Not applicable

Re: how to call macro in a loading script ?

hi

LET vVar= kk();  is not working

MVP & Luminary
MVP & Luminary

Re: how to call macro in a loading script ?

Hi,

Check this URLs

Execute a Macro inside load script

Example Macro:

Function CreateFolder()  

     Dim objFSO  

     Set objFSO = CreateObject("Scripting.FileSystemObject") 

     objFSO.CreateFolder("C:\MacroTestFolder") 

End Function 



QlikView Load Script:

  1. LET CreateFolder = CreateFolder(); 

Regards,

Jagan.

MVP
MVP

Re: how to call macro in a loading script ?

Could you post your sample app that demonstrates the issue?

luciancotea
Valued Contributor

Re: how to call macro in a loading script ?

See Jagan's example.

Be aware that you cannot access interface elements at LOAD SCRIPT time. For example, if you want to export a chart, it will not work.

Not applicable

Re: Re: how to call macro in a loading script ?

hi

See attached

luciancotea
Valued Contributor

Re: how to call macro in a loading script ?

You can't access interface objects at LOAD SCRIPT time. You have to call your macro using a trigger after the script is run (like OnPostReload trigger)

Not applicable

Re: Re: how to call macro in a loading script ?

hi

See attached

MVP
MVP

Re: how to call macro in a loading script ?

As said by Lucian Cotea, you can't access UI object at load script. While you call a macro in the script, it is expected that the macro function would return a value whic is not the case with your macro.