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

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

Passing String to Macro

Hi all,

I'm trying to execute a macro from load script. But I need to pass a string to the macro function. But for some reason, the string is not passed. Here is an example:-

Macro:

function createFile(a)

     set fso = CreateObject("Scripting.FileSystemObject")

    set s = fso.CreateTextFile("D:\test.txt", True)

    s.writeline(a) //it is not wring anything to the file

    s.Close()       

end function

In the load script:-

LET vTest = createFile("testing script");

Any idea on what is wrong in the script above?

Thanks.

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

There should be single, not double quotes, around your string.

LET vTest = createFile('testing script');


Also make sure your Module security is set to "Allow System Access".


-Rob

http://masterssummit.com

http://robwunderlich.com




View solution in original post

2 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

There should be single, not double quotes, around your string.

LET vTest = createFile('testing script');


Also make sure your Module security is set to "Allow System Access".


-Rob

http://masterssummit.com

http://robwunderlich.com




Not applicable
Author

Thanks! It works now. I remember that I tested it with single quote, but it didn't work. So I tried the double quote... weird!