5 Replies Latest reply: May 27, 2011 5:53 AM by Ivo Schnüll RSS

    VBS scheduled task

    Daniel Viklinder

      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

        • VBS scheduled task
          Ivo Schnüll

          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

            • VBS scheduled task
              Daniel Viklinder

              Hi Ivo,

               

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

               

              BR

              /Daniel

                • VBS scheduled task
                  Ivo Schnüll

                  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

                    • VBS scheduled task
                      Andrea Gigliotti

                      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

                    • VBS scheduled task
                      Ivo Schnüll

                      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