using multiple internet explorer page loop help to define ie

SQUIDD

Well-known Member
Joined
Jan 2, 2009
Messages
2,104
Office Version
  1. 2019
  2. 2016
Platform
  1. Windows
Hi all

I want to open 6 internet explorer pages and grab data.
in my code below i have a for loop a = 1 - 6.
what is the correct way to use my a(1-6) as the new ie page.
so the part in the code should be something like "ie" & a that would equal ie1 on the 1st loop.

Code:
Sub download()

Dim ie As InternetExplorer

For a = 1 To 6
Set ie(1 - 6) = New InternetExplorer
With ie(1 - 6)

    .Visible = True
    .Navigate "web page"
    Do While ie(1 - 6).Busy: DoEvents: Loop
    Do While ie(1 - 6).ReadyState <> 4: Loop
End With

Next a

End Sub

Thanks for looking. Im ok with everything else, just not sure on the syntex for the a(1-6)
I want to open all the pages 1st, then go back to ie1 and send keys then ie2 etc
this way my data has time to load before i finally return to grab the loaded data.

Dave
 
Last edited:

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
put another way

how to i make the following long code into a neat loop

Code:
Sub download()

Dim ie1 As InternetExplorer
Dim ie2 As InternetExplorer
Dim ie3 As InternetExplorer
Dim ie4 As InternetExplorer
Dim ie5 As InternetExplorer
Dim ie6 As InternetExplorer


Set ie1 = New InternetExplorer
With ie1

    .Visible = True
    .Navigate "http://www.gbgb.org.uk/RaceCard.aspx?dogName=Mynamesjeff"
    Do While ie1.Busy: DoEvents: Loop
    Do While ie1.ReadyState <> 4: Loop
End With

Set ie2 = New InternetExplorer
With ie2

    .Visible = True
    .Navigate "http://www.gbgb.org.uk/RaceCard.aspx?dogName=Mynamesjeff"
    Do While ie2.Busy: DoEvents: Loop
    Do While ie2.ReadyState <> 4: Loop
End With

Set ie3 = New InternetExplorer
With ie3

    .Visible = True
    .Navigate "http://www.gbgb.org.uk/RaceCard.aspx?dogName=Mynamesjeff"
    Do While ie3.Busy: DoEvents: Loop
    Do While ie3.ReadyState <> 4: Loop
End With

Set ie4 = New InternetExplorer
With ie4

    .Visible = True
    .Navigate "http://www.gbgb.org.uk/RaceCard.aspx?dogName=Mynamesjeff"
    Do While ie4.Busy: DoEvents: Loop
    Do While ie4.ReadyState <> 4: Loop
End With

Set ie5 = New InternetExplorer
With ie5

    .Visible = True
    .Navigate "http://www.gbgb.org.uk/RaceCard.aspx?dogName=Mynamesjeff"
    Do While ie5.Busy: DoEvents: Loop
    Do While ie5.ReadyState <> 4: Loop
End With

Set ie6 = New InternetExplorer
With ie6

    .Visible = True
    .Navigate "http://www.gbgb.org.uk/RaceCard.aspx?dogName=Mynamesjeff"
    Do While ie6.Busy: DoEvents: Loop
    Do While ie6.ReadyState <> 4: Loop
End With



cheers

dave
 
Upvote 0

Forum statistics

Threads
1,214,784
Messages
6,121,540
Members
449,038
Latest member
Guest1337

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top