Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I have a batch file setup on Windows Task Scheduler which works fine with the following code in the batch file:
echo off
echo.
echo Initialize the log file with Command Line reload...
echo Run QlikView and Reload Data...
"C:\Program Files (x86)\QlikView\Qv.exe" /r "C:\Users\bob\Dashboard.qvw"
However, the same batch file does not work if the Qlikview document has a macro that is triggered OnOpen. What might the issue be?
I just replied with the code but it has links for SMTP server so it says "Currently being moderated".
Hi, this is still not working. It still shows "Running".
I don't think the OnOpen macro fires when your run with /r ??
Really? What should I use then?
OnPostReload? But if the OnOpen trigger doesn't fire, then what is blocking your document?
OnOpen will fire when using /r.
Is it actions or macrocode?
Try to remove code until it works, then try to figure out what the problem is.
You are using Z:\ drive. If you log in as the service account, does Z drive exists then?
Has the service account correct security rights on that share?
I recommend using UNC instead of mapped drives.
Login as the service account and do a manual reload.
The only solution I have got to work so far is this:
Add this at the end of your macro.
ActiveDocument.Save
ActiveDocument.GetApplication.Quit
This will save the reloaded document and close the document when finished.
Your batchfile should look something like this:
"C:\Program Files\QlikView\qv.exe" /l /NoSecurity "C:\QV\ReportGenerator.qvw"
/l opens and reload the document (does not save and close like /r
/NoSecurity makes sure that you dont have to click a button to accept macros.
Hope it helps.
//Martin
Thanks all for your help. It seems even the other BAT file is not working which leads me to believe I may have lost local admin rights to run tasks when my user is logged off. I need the privileges to run tasks when logged off (run as a service) first. Thanks.