Opening multiple webpages

Posted on 2006-04-04
Last Modified: 2010-05-01
Hello Experts. I have a browser control through which I want to open many web pages, one at a time, wherein I will search for information that may have changed. I don't need help with how to search for the info I'm looking for. What I need your help with is how to go through one page at a time, waiting till the seach therein is done before moving on to the next URL. I've gotten very rusty working with Arrays, so I'll need some extra attention here. This page seems to be onto something, but I need more elaboration:

Many kind thanks in advance,
Question by:John Account
    LVL 16

    Accepted Solution

    A very basic example, using the WebBrowser control, is to try the following (using a form -- Form1, with a button -- Command1 -- and a WebBrowser -- WebBrowser1):

        Sub Command1_Click()
            Dim szURL as Variant, a_szURLs As Variant
            Set a_szURLS = Array("", _
                                             "", _
                                             "", _

            For Each szURL In a_szURLs                                                                           'LOOP THROUGH THE URLS
                WebBrowser1.Navigate2 szURL                                                                   'LOAD THE URL
                Do Until (WebBrowser1.ReadyState = 4) And (WebBrowser1.Busy = False)    'ALLOW PAGE TO LOAD
            Next szURL
        End Sub

        Sub DoYourCheck()
        End Sub



    Author Comment

    by:John Account
    Getting a Type Mismatch on that array.
    LVL 16

    Expert Comment

    Take out the Set command:

        a_szURLs = Array(...)


    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Join & Write a Comment

    Introduction While answering a recent question ( in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
    If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
    This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now