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