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

Announcements
Share your agentic AI experience, learn from others, and earn a new badge: Put Agentic AI to Work
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

Labels (1)
2 Replies
fosuzuki
Luminary
Luminary

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