Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have an export to excel macro which runs on a button click in a QlikView dashboard.
I want to keep the macro code outside QlikView (May be in a notepad) and just call it from QlikView macro module and run it.
Is it possible to do it in macro edit module similar to include statement in script?
Thanks in advance.
Yes, it is. Take here a look on the suggestion from Rob: Include-external-module-macro-code
- Marcus
Take here a look on the suggestion from Rob: Include-external-module-macro-code
The above link helped me to solve the problem.
But we need to call the actual macro name inside the commonFunction.vbs file to execute it.
Calling IncludeCommon macro is not working for me.
Below is the macro code I used to call the another macro in an external vbs file.
Call IncludeCommon
Sub IncludeCommon
Dim objFSO, file, str
Set objFSO = CreateObject("Scripting.FileSystemObject")
set mypath = ActiveDocument.GetProperties
directory = mypath.MyWorkingDirectory
codefile = directory & "\commonFunctions.vbs"
Set file = objFSO.OpenTextFile(codefile)
str = file.ReadAll
ExecuteGlobal str
file.Close
End Sub
Yes, it is. Take here a look on the suggestion from Rob: Include-external-module-macro-code
- Marcus
Hi Marcus,
I used the code in the link provided in my file.
The IncludeCommon macro is not getting called from QlikView text box.
I have added it in a text box calling that macro with it's name, but when I click on it, nothing happens.
Thanks in advance.
Take here a look on the suggestion from Rob: Include-external-module-macro-code
The above link helped me to solve the problem.
But we need to call the actual macro name inside the commonFunction.vbs file to execute it.
Calling IncludeCommon macro is not working for me.
Below is the macro code I used to call the another macro in an external vbs file.
Call IncludeCommon
Sub IncludeCommon
Dim objFSO, file, str
Set objFSO = CreateObject("Scripting.FileSystemObject")
set mypath = ActiveDocument.GetProperties
directory = mypath.MyWorkingDirectory
codefile = directory & "\commonFunctions.vbs"
Set file = objFSO.OpenTextFile(codefile)
str = file.ReadAll
ExecuteGlobal str
file.Close
End Sub