how can i make the google search to accept an ENTER key to accept the string for search in VBA Excel Macro

Viewed 60

Sub chromauto()

Dim obj As New WebDriver
obj.Start "chrome", ""
obj.Get "http://google.com"
obj.FindElementByName("q").SendKeys 
("Airgas, Inc.    400 W Basin Rd  New Castle  Deleware    19720   United States   (302) 322-4687")

End Sub

1 Answers

Just add the "New Line" characters to the end of the search string. By the way, you probably don't want the parentheses around the argument list. Those are only needed if you are using the value that is returned by a function and "sendkeys" does not return a value.

obj.FindElementByName("q").SendKeys "Airgas, Inc.    400 W Basin Rd  New Castle  Deleware    19720   United States   (302) 322-4687" & vbNewLine
Related