Consulting

Results 1 to 4 of 4

Thread: Solved: auto-fill webpage search form

  1. #1

    Solved: auto-fill webpage search form

    I have a userform that a user completes and if the airport is not listed, the user clicks a button to open the webpage seach engine. After the user enters the airport name on the webpage he must click the submit button. I would like to eliminate this process and have the information already displayed when the webpage opens.

    The code I use to open to the webpage...

    Call ShellExecute(0&, "OPEN", "http://www.acukwik.com/Default.aspx", _vbNullString, vbNullString, 3)
    What I notice in the link below after I enter the name of the airport on the webpage, the only changes is the last word (RDU), which is the airport name

    http://www.acukwik.com/AirportInfo/KRDU

    Can some assist me in editing the code that will automatically display the webpage of the airport entered.

    Thank you kindly

  2. #2
    Maybe like this:
    [VBA]
    Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
    (ByVal hWnd As Long, ByVal lpOperation As String, _
    ByVal lpFile As String, ByVal lpParameters As String, _
    ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

    Private Const SW_SHOWNORMAL = 1

    Sub X()
    Dim airport As String
    airport = "KRDU"
    Call ShellExecute(0&, "OPEN", "h ttp://w ww.acukwik.com/AirportInfo/" & airport, vbNullString, vbNullString, SW_SHOWNORMAL)
    End Sub
    [/VBA]
    (Remove the spaces in the URL)

  3. #3
    Thank you Crocus Crow. Works Great!!!!

  4. #4
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Hi Both,
    When you post code, please use VBA tags or the green VBA button to format it (see post 2). Code tags don't do that here.
    Regards
    MD
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

Posting Permissions

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