Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

VBS scheduled task

Hi everyone,

I have a problem with a vbs-macro, it works when im logged in. But when i schedlue it in task scheduler it freezes. A qv.exe is open but the document is never loaded.

Se below macro:

set Qv = CreateObject("QlikTech.QlikView")

Set ActiveDocument = Qv.OpenDoc ("D:\QlikView\AccessPoint\Sales.qvw","","")

    activedocument.clearall

ActiveDocument.GetApplication.Sleep 10000

Qv.quit

Has anyone had problem with this?

BR

Daniel

6 Replies
Not applicable
Author

Hi Daniel,

We run into the same issue. I think qlikview will show a license message. To get around this you have to make sure that your scheduled task will run as a licensed user. Also the scheduled task need to load the userprofile. This enables qlikview to read the license information from the profile.

This solves the problem for us.

BR

Ivo

Not applicable
Author

Hi Ivo,

I run the scheduled task as an licensed user. But how can i make the scheduled task load the userprofile?

BR

/Daniel

Not applicable
Author

Hi Daniel,

We are using the RES Automation Manager Software to do this. If you want to do this with the task scheduler of the operating system you have to use the "runas" command to start qlikview..

BR

Ivo

agigliotti
Partner - Champion
Partner - Champion

Hi Ivo,

I have the same problem since I upgraded to version 10 SR1  from version 9.

below my vbs file:

Set MyApp = CreateObject("QlikTech.QlikView")

Set MyDoc = MyApp.OpenDoc ("E:\QlikView\Documents\Scadenze.qvw","","")

Set Button = MyDoc.GetSheetObject("Document\BU01")

Ret = Button.Press

Set MyDoc = Nothing

MyApp.Quit

Set MyApp = Nothing

What do you mean with "runas" command to start QlikView ?

I can't use the above vbscript file ?

Can you give me more info about it ?

Thanks in advance

Best regards

Andrea

Not applicable
Author

Hi Daniel,

I have tested this again.

1. Logon as a user.

2. create your script and make sure that it is runing correctly.

3.Create a small batch file with the following content:

cscript C:\batch\myscript.vbs

4. start your batch file and make sure that it is working correctly

5. create a scheduled task to start your batch file. On the last page of the scheduled Task wizard specify the credentials of the user you are currently using. It seems that this will load the userprofile correctly

This way it is working for us.

bye

Ivo

henrikalmen
Specialist
Specialist

I had the same problem and found this old thread so I'm posting the solution that worked for me: choose "Run only when user is logged on", instead of "Run whether user is logged on or not", in the scheduled task's settings. That will force QV desktop to open in foreground instead of in background, and that solved the problem for me.

Naturally,  the user account that is set to be running the task has to be logged in when the task is scheduled to run for this solution to work.