3

I am trying to ask VBA to navigate to a website ( and for the sake of argument lets say "www.google.com" ) and type in a search value in the search box there,

i have already got the opening the website and navigating to a website part done, but the tricky part is to get vba to input anything in that website, i read somethings about send keys but from what i gathered it is really not reliable because you will need it to interact with the active window which is not really that guaranteed, here is the code that i was able to compile so far,

Sub testing()
    Dim IE As Object

    Sheets ("sheet1")
    Range("P2").Select
    Selection.Copy
    Range("A2:H782").Select
    Sheets("sheet1").Paste
    Range("A1").Select

    Columns("A:M").Select
    Range("M1").Activate
    Selection.ClearContents

    Set IE = CreateObject("InternetExplorer.Application")
    With IE
        .Visible = True
        .Navigate "www.google.com" '
        Do While IE.Busy Or IE.readyState <> READYSTATE_COMPLETE
        DoEvents
        Loop


    End With
End Sub

now please excuse the messy code but then again this is my second time trying this

CallumDA
  • 12,025
  • 6
  • 30
  • 52
  • 1
    Possible duplicate of [Filling Internet Explorer inputbox](http://stackoverflow.com/questions/27483919/filling-internet-explorer-inputbox) – Venom Mar 26 '17 at 19:42

0 Answers0