Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
warfollowmy_ver
Creator III
Creator III

Connect vbs file from a script to run functions from this file

Earlier, I figured out how to connect a vbs file and use commands in the interface from this file https://community.qlik.com/t5/New-to-QlikView/Connect-vbs-files-into-document-and-use-macro-from-thi.... But what if I want to use functions from a file in the script itself? First I need to initialize them in the macro module, but how to do it from the script? 

Is it possible?

If you first initialize functions in the interface from the vbs file in the module for macros, then functions are available in the script, if you close and then open the document, then you need to re-open the module for macros.

Labels (3)
1 Solution

Accepted Solutions
Brett_Bleess
Former Employee
Former Employee

You have to write the VBScript function in the Edit Module, and then you can call that custom function from the load script.  Here is a link regarding VBScript syntax:

https://stackoverflow.com/questions/41965404/functions-vs-sub-procedures

Here is Help on VBScript function call from the script:

http://help.qlik.com/en-US/qlikview/April2019/Subsystems/Client/Content/QV_QlikView/VBFunctionCalls....

If you were going to use the script function in an expression, you would need to enable the following setting:

AllowMacroFunctionsInExpressions

I cannot find anything about needing to change any other settings to use the script function from the edit module in the Load Script.  Hopefully this helps you move things forward.

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.

View solution in original post

1 Reply
Brett_Bleess
Former Employee
Former Employee

You have to write the VBScript function in the Edit Module, and then you can call that custom function from the load script.  Here is a link regarding VBScript syntax:

https://stackoverflow.com/questions/41965404/functions-vs-sub-procedures

Here is Help on VBScript function call from the script:

http://help.qlik.com/en-US/qlikview/April2019/Subsystems/Client/Content/QV_QlikView/VBFunctionCalls....

If you were going to use the script function in an expression, you would need to enable the following setting:

AllowMacroFunctionsInExpressions

I cannot find anything about needing to change any other settings to use the script function from the edit module in the Load Script.  Hopefully this helps you move things forward.

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.