I am trying to manipulate Chrome from the Excel VBE using the Selenium add-in.
- I have included Selenium Type Library in my references.
- I am running Chrome v67.
- I have replaced the Chromedriver.exe file in the Selenium Basic directory with the version compatible with Chrome v67 (i.e. Chromedriver version 38).
My VBA code:
Public Sub seleniumtutorial()
Dim bot As New WebDriver
'bot.AddArgument "--headless"
'bot.AddArgument "--disable-extensions"
bot.Start "chrome", "http://google.com"
bot.Get "/"
bot.TakeScreenshot.SaveAs (ActiveWorkbook.Path + "/screenshot.jpg")
bot.Quit
End Sub
I am getting the following error message:
If I include this line of code there is no error message but then I cannot see the Chrome window:
bot.AddArgument "--headless"
If I include this line of code, as was suggested on SO answers to a similar question, it doesn't solve the issue.
bot.AddArgument "--disable-extensions"