Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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
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
Hi Marcus_Sommer,
Thanks for reply. I have tried the same but getting an error.
PFA the error scrrenshot.
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
Try to run the same code for an another application and see.
Hi,
I have tried the same for other application but can't get success.
Not sure, Check the below link