Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
james
Creator III
Creator III

QlikView VBS Error Objectrequired:ActiveDocument

All, anyone know why I am getting "Object Required:ActiveDocument...If I restart the PC, it runs once fine...

Set MyApp = CreateObject("QlikTech.QlikView")

Set MyDoc = MyApp.OpenDoc ("c:\Test.qvw","","")

Set ActiveDocument = MyDoc

ActiveDocument.GetSheetObject("BU1").Press

MyDoc.CloseDoc

Set MyDoc = Nothing

MyApp.Quit

Set MyApp = Nothing

11-9-2014 1-08-27 PM.jpg

5 Replies
michael_anthony
Creator II
Creator II

I'd suggest putting myApp.ActiveDocument.GetSheet....  the interpreter may not know which application your referring to with your ActiveDocument statement.

I'm not sure you using the ActiveDocument as intended though, why not skip that part and just refer to myDoc.GetSheetObject(....)

jagan
Luminary Alumni
Luminary Alumni

Hi,

Try this

Set MyApp = CreateObject("QlikTech.QlikView")

Set MyDoc = MyApp.OpenDoc ("c:\Test.qvw","","")

Set currentDocument = MyDoc

currentDocument.GetSheetObject("BU1").Press

MyDoc.CloseDoc

Set MyDoc = Nothing

MyApp.Quit

Set MyApp = Nothing

OR

Set MyApp = CreateObject("QlikTech.QlikView")

Set MyDoc = MyApp.OpenDoc ("c:\Test.qvw","","")

MyDoc.ActiveDocument.GetSheetObject("BU1").Press

MyDoc.CloseDoc

Set MyDoc = Nothing

MyApp.Quit

Set MyApp = Nothing

Regards,

Jagan.

james
Creator III
Creator III
Author

It works once than the 2nd try it renders the same message .

james
Creator III
Creator III
Author

Anyone? anyone?


michael_anthony
Creator II
Creator II

what does the BU1 do when you press it?  perhaps the action it triggers is compromising your environment and leaving something open.