Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
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
Author

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.

View solution in original post

11 Replies
Not applicable
Author

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
Author

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
Author

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
Author

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

Not applicable
Author

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
Author

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
Author

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
Author

Hello!

You can tell more about these settings?