Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm trying to execute a Jscript function during a load script but it looks like the command is not executed at all.
I have the following Jscript function:
The functions works correctly when executing using "Run Macro" button.
I looked at previous forum posts and this command should work;
How do a call a Jscript function from a load script?
Are there security settings that prevents this from working?
Thanks,
Jonas
The current code looks like this;
Jscript
Load script
The script should connect to a web server that send a POST request to Google Sheets API to update the format of a specific sheet.
A qmc-tasks doesn't execute "classical" macros - by macro-functions during the load-script I'm not sure but I could imagine that this is also disabled.
In this case you could try to outsource your macro into an external batch which could be triggerred within the load with an EXECUTE statement. Here an example what is meant: Re: Run Excel macro via QMC.
The input/output from your routine mustn't be necessary a parameter for the batch-call you could also use QV store/load for it, for example:
[$(sPath)]:
load '$(sPath)' autogenerate 1;
store [$(sPath)] into Parameter.txt (txt);
and your routine read this parameter and stored its output again into a txt-file which QV reads afterwards within a load.
- Marcus
In the QMC Server Security settings, you will have to check on both:
Allow macro execution on server
Allow unsafe macro execution on server
-Rob
Botg of those are already checked
What error do you get in the script? Or no error but incorrect output?
Thank you all for your input.
My conclusion is the QMC does not execute any macros.
Using EXECUTE and BAT to execute the script would have been possible but includes several steps that could potentially fail.
My solution (verified) is to use Qlik REST Connector;
I needed to run a SQL Select statement and use WITH Connection to execute the POST command.