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

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

macro function with parameters

Hi all,

I'd like to create a function to export objects to Excel. I'd like to create a single function with parameters, so i can call it from different sheet, and i just have to set the object i want to export in the concerned sheet.

The function is :

sub exportExcel(param1, param2)

     'Open Excel

      set XLApp = CreateObject("Excel.Application") ' Define Object

      XLApp.Visible = True 'Visible set as true

      set XLDoc = XLApp.Workbooks.Add 'Open new workbook

      ....

end sub

    

What is the correct syntax to use and declare parameters in a function.

Regards

Gilles

2 Replies
fosuzuki
Partner - Specialist III
Partner - Specialist III

Hi Gilles,

as far as I know, you can use functions with parameters in the Script but NOT in an Action. One workaround is to call the sub without parameters, and indide the Sub you get the values from variables.

Hope this helps you.

regards,

Fernando

Not applicable
Author

Hello Fernando,

Is possible to use the QlickView  variable or field content in a macro?

Thank You

Guillermo