1

I am very new to Vbscript, however its one of the only tools available to me at my current employment. We have a web based system that I am trying to interact with. The web page reloads frequently. Such as choosing a drop down box the page will hang for a moment while it reloads the page. My script currently pauses for a few seconds between each command, but sometimes does not wait long enough. I was wondering if I could create an IE object from the existing window and check its busy status. So when its done processing I could move on to the next command.

I have already tried: Set IE = GetObject(, "internetexplorer.application") however it gives me an error that: ActiveX component can't create object 'GetObject'

I have spend a great deal of time searching google and a few other places to see if there is a simple alternative but have found none. this is going to be an HTA application.

  • I forgot to mention, it is IE7 windows XP. – Bazooka_Duke Apr 11 '12 at 17:24
  • tried to do such things in vbscript and HTA in the past, will never be reliable. Now i use ruby, easily to install also on windows and is a dream to work with, especially in combination with the web – peter Apr 12 '12 at 00:31

1 Answers1

0

Rather than try to use GetObject to latch on to existing instance you can use the code at this link reusing Internet Explorer COM Automation Object

But instead I think you should you an approach like below which checks for the ReadyState of the automated ie object being ready

Dim ieObject
Set ieObject = CreateObject("internetexplorer.application")
ieObject.Navigate "www.google.com"
Do While ieObject.readystate <> 4
WScript.Sleep 100
Loop
Community
  • 1
  • 1
brettdj
  • 54,857
  • 16
  • 114
  • 177