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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
er_mohit
Master II
Master II

VB Script Error : Object Required

Hi All,

I have tried lots of stuff to sort out vb script issue while run macro code thorugh batch file but can't get success.

Given below my macro code.

set MyApp = CreateObject("QlikTech.QlikView")

Set MyDoc = MyApp.OpenDoc("F:\QlikView\Dev\testdata.qvw","","")

Set ActiveDocument = MyDoc

ActiveDocument.Reload

Set Button1 = ActiveDocument.GetSheetObject("BU01")

Button1.Press

WScript.Sleep(100000)

MyDoc.GetApplication.Quit

Set MyDoc = Nothing

Set MyApp = Nothing

When i run through qlikview it works perfectly but the same not work through .vbs  file. When i run the batch file it gives an error.

Please find attached the error screenshot.

Any help will be appreciable.

Regards

Mohit

7 Replies
marcus_sommer

Try:

set MyApp = CreateObject("QlikTech.QlikView")

Set MyDoc = MyApp.OpenDoc("F:\QlikView\Dev\testdata.qvw","","")

MyDoc.Reload

Set Button1 = ActiveDocument.GetSheetObject("BU01")

Button1.Press

WScript.Sleep(100000)

MyDoc.GetApplication.Quit

Set MyDoc = Nothing

Set MyApp = Nothing

- Marcus

tamilarasu
Champion
Champion

Try,

Sub er()

set MyApp = CreateObject("QlikTech.QlikView")

Set MyDoc = MyApp.OpenDoc("C:\Users\Tamilarasu.Nagaraj\Desktop\New folder (2)\Test_Sowmya - Copy.qvw","","")

MyDoc.Reload

Set Button1 = ActiveDocument.GetSheetObject("BU01")

Button1.Press

WScript.Sleep(100000)

MyDoc.GetApplication.Quit

Set MyDoc = Nothing

Set MyApp = Nothing

End Sub

er_mohit
Master II
Master II
Author

Hi  Marcus_Sommer‌,

Thanks for reply. I have tried the same but getting an error.

PFA the error scrrenshot.

marcus_sommer

It seems that the file-path isn't correct or that the proper access rights are missing. This can happen if you executed the batch from another machine (you might need to use unc-paths or to mount this drive) or another user-account.

- Marcus

tamilarasu
Champion
Champion

Try to run the same code for an another application and see.

er_mohit
Master II
Master II
Author

Hi,

I have tried the same for other application but can't get success.

tamilarasu
Champion
Champion

Not sure, Check the below link

Vbscript error when trying to reload and export