

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Marcus_Sommer,
Thanks for reply. I have tried the same but getting an error.
PFA the error scrrenshot.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try to run the same code for an another application and see.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I have tried the same for other application but can't get success.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Not sure, Check the below link
