Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Not applicable

.vbs not working when not logged in

I have a .VBS script to launch a QlikView file and do some stuff with it.

Everything works great when I'm logged into my account, but when I run the vbs as a scheduled task, it doesn't work.

The script looks like this:

Line 1: Set Qv = CreateObject("QlikTech.QlikView")

Line 2: wscript.sleep 2000

Line 3: Set docObj = Qv.OpenDoc(qvPath, "", "")

I have narrowed it down to line 1 being the point of error. The script exists when trying to execute line 1.

I have made sure that the script is run by the same account, but I must be doing something wrong.

Any help is appreciated.

My only requirement for getting this to work, is that I can acces the QV file as an object through the dobObj variable, as the rest of my script depends on it.

1 Solution

Accepted Solutions
Not applicable

Re: .vbs not working when not logged in

I managed to solve my problem simply by running an empty instance of qlikview via:

Set oShell = CreateObject("WScript.Shell")

oShell.Run "Path to qv.exe"

Doing this before I attempt to create the qlikview object preventet the error from occuring.

11 Replies
Not applicable

Re: .vbs not working when not logged in

Upon investigation, I get the following error:

Microsoft VBScript runtime error: ActiveX component can't create object: 'QlikTech.QlikView'

This is what's causing the pain. Any suggestions on how to fix this?

Not applicable

Re: .vbs not working when not logged in

Hello,

   I had a similar issues in a different exemple.

Did you try to create and schedule the task with an user with administrator grants? It worked for me.

Regards,

Daniele

Not applicable

Re: .vbs not working when not logged in

Daniele,

The user is a member of the groups "Administrators"

Further, creating a .bat file with the following contents works without any problems

"C:\Program Files\QlikView\qv.exe" /NoSecurity /vbatch_flag=1 "C:\testfile.qvw"

But the .vbs doesn't

If I use regsvr32 to register qvp.dll and qlikocx.ocx it fails at the exact same point, but with no error message.

Not applicable

Re: .vbs not working when not logged in

Friend, I would suggest two checks, maybe not that, but I'm trying to help in some way:

1) vbs in module options you selected:

      required security module = System Access

      Current Local Security = Allow access to the system

2) If your application is a server I suggest you do a test leaving a connected session (prey). It happened to me several times while I was logged into the server with a user admin the schedule worked, but when you log off did not work!

good luck

Stive - Brazil

jsn
Honored Contributor

Re: .vbs not working when not logged in

Not applicable

Re: .vbs not working when not logged in

Thanks for the suggestion Johannes!

My server is Windows 2003 and apparently does not have the same configuration options ...

I searched for something similar but got no success.

I tried the procedures suggested for 2008 but confusing Were Sleeping ...!

Even so thank you!

Stive - Brazil

Not applicable

Re: .vbs not working when not logged in

I managed to solve my problem simply by running an empty instance of qlikview via:

Set oShell = CreateObject("WScript.Shell")

oShell.Run "Path to qv.exe"

Doing this before I attempt to create the qlikview object preventet the error from occuring.

Not applicable

Re: .vbs not working when not logged in

Dude, you tried to access the free module vb as I suggested earlier?

Security Module Required: System Access

Current Local Security: Allow System Access

I did a quick test here and gave no mistake! ...

Anything verify the syntax of your code on google or websites specializing in vbscript ...

hugs

Stive - Brazil

Not applicable

Re: .vbs not working when not logged in

Hello!

You can tell more about these settings?

Community Browser