+ Reply to Thread
Results 1 to 2 of 2

VBA IE Navigating

Hybrid View

  1. #1
    Registered User
    Join Date
    06-24-2015
    Location
    Atlanta
    MS-Off Ver
    13
    Posts
    8

    VBA IE Navigating

    I am a novice to VBA and am attempting to extract information from multiple websites. I will be forever grateful for any help. I have searched but haven't found anything quite like what I am attempting. I need to navigate to one webpage (strURL5 in my code) and then to strURL6 in one instance of IE. Or navigate to strURL5 and then select a specific link from that webpage. I know this is probably trivial, but I am going insane trying to figure this out.


    Here is the code I currently have:


     
    Sub GetAllOrgData()
    
    Dim HTMLdoc As HTMLDocument
    Dim ie As Object
    Dim doc As Object
    Dim doc2 As Object
    Dim doc3 As Object
    Dim doc4 As Object
    Dim doc5 As Object
    Dim doc6 As Object
    Dim strURL As String
    Dim strURL2 As String
    Dim strURL3 As String
    Dim strURL4 As String
    Dim strURL5 As String
    Dim strURL6 As String
    
    
    strURL = "https://blahblahblah" & Range("OrgID").Value & "&RegistrationLocationId="
    strURL2 = "https://blahblahblah" & Range("OrgID").Value
    strURL3 = "blahblahblah" & Range("OrgID").Value & "/integrationevents?from=" & Range("FOM").Value & "&to=" & Range("EOM").Value & "blahblahblah"
    strURL4 = "blahblahblah" & Range("OrgID").Value
    strURL5 = "https://THIS IS THE WEBPAGE I NEED TO LOAD FIRST" & Range("OrgID").Value & "/reports"
    strURL6 = "https://THIS IS THE WEBSITE I NEED TO GET INFORMATION FROM"
    
    Set ie = New InternetExplorerMedium
    With ie
    Visible = True
    
     
    ie.navigate strURL
    Do Until .readyState = 4: DoEvents: Loop
    Do While .Busy: DoEvents: Loop
    Set doc = ie.document
    GetAllTables doc
    
    ie.navigate strURL2
    Do Until .readyState = 4: DoEvents: Loop
    Do While .Busy: DoEvents: Loop
    Set doc2 = ie.document
    GetAllTables2 doc2
    
    ie.navigate strURL3
    Do Until .readyState = 4: DoEvents: Loop
    Do While .Busy: DoEvents: Loop
    Set doc3 = ie.document
    GetAllTables3 doc3
    
    ie.navigate strURL4
    Do Until .readyState = 4: DoEvents: Loop
    Do While .Busy: DoEvents: Loop
    Set doc4 = ie.document
    GetAllTables4 doc4
    
    
    
    ie.navigate strURL5
    Do Until .readyState = 4: DoEvents: Loop
    Do While .Busy: DoEvents: Loop
     
    ie.navigate strURL6
    Do Until .readyState = 4: DoEvents: Loop
    Do While .Busy: DoEvents: Loop
    Set doc5 = ie.document
    GetAllTables5 doc5
    
    End With
    End Sub
    Last edited by alansidman; 10-26-2015 at 09:55 AM. Reason: code tags added

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2406 Win 11 Home 64 Bit
    Posts
    23,982

    Re: VBA IE Navigating

    Code Tags Added
    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE] [/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found at http://www.excelforum.com/forum-rule...rum-rules.html



    (Because you are new to the forum, I have added them for you today. Please take a few minutes to read all Forum Rules and comply in the future.)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Navigating through worksheets
    By floricita in forum Excel General
    Replies: 3
    Last Post: 10-13-2010, 07:03 AM
  2. Navigating In Excel
    By udaman55 in forum Excel General
    Replies: 1
    Last Post: 05-09-2008, 12:04 PM
  3. navigating the spreadsheet
    By JBCA in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-07-2006, 08:06 PM
  4. Navigating a Queue
    By John in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-25-2006, 05:35 PM
  5. Navigating between cells
    By [email protected] in forum Excel General
    Replies: 3
    Last Post: 06-30-2006, 09:30 AM
  6. Navigating with a macro
    By Brian Matlack in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-23-2006, 02:07 PM
  7. [SOLVED] Navigating
    By Gibbie in forum Excel General
    Replies: 9
    Last Post: 01-31-2005, 07:06 PM
  8. Navigating among worksheets
    By Phil Hageman in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 01-10-2005, 12:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1