+ Reply to Thread
Results 1 to 7 of 7

Web Query Requires Form Fill In

Hybrid View

  1. #1
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Web Query Requires Form Fill In

    Hello Bryan,

    I can write code for you to do this using Internet Explorer. Will that work for you?
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  2. #2
    Registered User
    Join Date
    06-25-2010
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Web Query Requires Form Fill In

    Thanks! That would be great!

    Bryan

  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Web Query Requires Form Fill In

    Hello Bryan,

    This macro will start Internet Explorer and open the the web page. It will then fill in the license number and click submit.
    Sub GetLicenseInfo(LicenseNumber As Variant)
    
      Dim Btn As Object
      Dim ieApp As Object
      Dim ieDoc As Object
      Dim InputBtns As Object
      Dim LicenseBtn As Object
      Dim SubmitBtn As Object
      Dim URL As String
      
        URL = "http://www.ncbpe.org/process_request.php"
        
        Set ieApp = CreateObject("InternetExplorer.Application")
        
          ieApp.Navigate2 URL
          ieApp.Visible = True
          
            While ieApp.ReadyState <> 4
              DoEvents
            Wend
            
            Set ieDoc = ieApp.Document
            
            Set InputBtns = ieDoc.GetElementsByTagName("Input")
              
              For Each Btn In InputBtns
                 If Btn.Value = " Submit search " Then
                   Set SubmitBtn = Btn
                 End If
                 If Btn.Name = "license" Then
                   Set LicenseBtn = Btn
                 End If
              Next Btn
            
            LicenseBtn.Value = LicenseNumber
            SubmitBtn.Click
            
    End Sub

    Example of Calling the Macro
    Sub TestIt()
    
      GetLicenseInfo 211
      
    End Sub

  4. #4
    Registered User
    Join Date
    06-25-2010
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Web Query Requires Form Fill In

    Thank you. For some reason I could not see the code but logged in today and it works great!

    Thanks again!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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