Internet Explorer is busy

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
Danzig
Newbie
Posts: 10
Joined: Wed Oct 20, 2004 6:52 pm

Internet Explorer is busy

Post by Danzig » Wed Nov 03, 2004 3:37 pm

Hello

I'm trying to write something to launch internet explorer and wait until the page is loaded to progress to the next step. I have seen a few examples posted using vbs that are the same way I write them in vbs but they don't seem to work in the MS realm.

Working Vbs code ( this can be cut and pasted to test )

Code: Select all

Dim IE 
  Set oIE = CreateObject("InternetExplorer.Application") 
  	  oIE.visible = 1 
  	  oIE.navigate "http://www.google.com/"
The code above works just fine in Vbs with no errors and I use it quite a bit in Vbs.

The code below is MS code using the Vbs code above

Code: Select all

VBSTART 

Sub OpenPage

  Dim oIE 
  oIE = CreateObject("InternetExplorer.Application") 
  	  oIE.visible = 1 
  	  oIE.navigate "http://sa.ams.solvay.com/" 

End Sub 

VBEND 

VBR>OpenPage
The code above generates the following MS error

Macro Scheduler

Microsoft VBScript compilation error : 1002

Syntax error

Line 14, Colum 3


Any of you MS experts out there know why this is happening? It doesn't seem to make any sense as the exact same code works fine as pure Vbs. If you notice normally in Vbs writers tend to reference the WScript object which you can't seem to do with in MS but I have not done that here and Vbs will still run the code with out a problem since the WScript object recognizes the CreateObject call being made.

Any advice or is there a MS way of telling if the IE object is still busy loading a page?

Support please feel free to respond to this also.

Thanks

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Thu Nov 04, 2004 3:30 pm

You've missed out the word 'Set'. Your code will fail outside of Macro Scheduler to. Your code should be:


VBSTART

Sub OpenPage

Dim oIE
Set oIE = CreateObject("InternetExplorer.Application")
oIE.visible = 1
oIE.navigate "http://sa.ams.solvay.com/"

End Sub

VBEND

VBR>OpenPage
MJT Net Support
[email protected]

Danzig
Newbie
Posts: 10
Joined: Wed Oct 20, 2004 6:52 pm

Post by Danzig » Thu Nov 04, 2004 3:56 pm

Well actually this

Code: Select all

VBSTART 
Public oIE 

Sub CreateIE 
  Set oIE = CreateObject("InternetExplorer.Application") 
  oIE.visible = 1 
End Sub 

Sub Navigate(URL) 
  oIE.navigate URL 
End Sub 

Sub WaitBusy 
  do while oIE.Busy     
  loop 
End Sub 

Sub DestroyIE 
  oIE.Quit 
  Set oIE = Nothing 
End Sub 

VBEND 

VBRun>CreateIE 
VBRun>Navigate,http://www.google.com/ 
VBRun>WaitBusy 
Is directly out of one of the examples that Support had linked in a different thread. And it doesn't seem to work either. Any help would be appreciated.

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Thu Nov 04, 2004 4:07 pm

I just copied this code from your message here direct to Macro Scheduler and it worked fine. Which version of Macro Scheduler are you using btw (see under Help/About)?
MJT Net Support
[email protected]

Danzig
Newbie
Posts: 10
Joined: Wed Oct 20, 2004 6:52 pm

Post by Danzig » Thu Nov 04, 2004 4:11 pm

7.2.050

User avatar
Captive
Macro Veteran
Posts: 213
Joined: Sun Oct 20, 2002 8:37 pm
Location: Colorado, USA

Post by Captive » Sat Nov 06, 2004 12:50 am

I've used a similar method in many scripts. The only significant difference I can see, is the one I use has a 'wait' in the busy line:
"do while IE.Busy and Wait"

However, I tried your script in v7.3.01 and it worked as expected.
I am using MSIE v6.0 on WinXP.

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Sat Nov 06, 2004 3:50 am

I just ran the script from Danzig, Posted: Thu Nov 04, 2004 10:56 am, with no apparent errors, and Google came right up in MSIE as expected.

Tested using Macro Scheduler 7.3.01 with Win98ME, MSIE 6.0.2600.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

User avatar
Monkster
Junior Coder
Posts: 42
Joined: Fri Oct 04, 2002 9:37 pm
Location: On an Island with Wilson

Post by Monkster » Sat Nov 06, 2004 8:05 am

I just tried the script as well using MS 7.3.01 and it worked.

Since using the word SET are you still getting the VBS error or is IE now giving you a "The Page Cannot Be Displayed...Cannot find server or DNS Error" :?:

If you are trying to open http://sa.ams.solvay.com/ as you mentioned in your first post, it seems to be a bad URL. I tried it manually in IE and Firefox then checked http://www.dslreports.com/whois all with no luck.
Best Wishes,
Monkster

Danzig
Newbie
Posts: 10
Joined: Wed Oct 20, 2004 6:52 pm

Post by Danzig » Mon Nov 08, 2004 2:02 pm

It worked fine on its own that was a prt of a script there was a lot of other stuff I'd added in to it. A function I had was causin the problem.


Thanks for the help

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts