2

Please help me to solve this problem, i have tried many ways since one month ago, but i always failed.

I use Windows 7, Service Pack 1, 64 bit - Microsoft Excel professionl plus 2019. My Current Chrome version is 94.0.46, I have tried other versions as well. I use Chromedrive version 94.0.4606 but also have tried 93 and 92 versions. I have tried different versions of SeleniumBasic, from 2.0.2.0 to 2.0.9.0 . Also Google Chrome is not running as an administrator.

What i do always is: I uninstll Selenium, install it again or its another versaion, download the same chromedrive version that my google chrome uses, copy the chromedrive into the Selenium folder, either in "program files" path or "users" path and start it. Also "selenium Type Library" is selected in VBA References.

I run a very simple code:

Sub TestSelenium()
   Dim Mybrowser As Selenium.ChromeDriver
   Set Mybrowser = New Selenium.ChromeDriver
   Mybrowser.Start
End Sub

I always get same error:

Please replace this obnoxious image with a transcript

tripleee
  • 175,061
  • 34
  • 275
  • 318
Some One
  • 55
  • 5
  • 1
    Please [don’t post images of code, error messages, or other textual data.](https://meta.stackoverflow.com/questions/303812/discourage-screenshots-of-code-and-or-errors) – tripleee Sep 29 '21 at 08:01

1 Answers1

1

Define Mybrowser as webdriver. Please try below code.

Sub TestSelenium()
   Dim Mybrowser As new webdriver
   Mybrowser.start "chrome"
   Mybrowser.get "https://google.com"
   Application.Wait Now+Timevalue("00:00:20")   
End Sub
Nandan A
  • 2,702
  • 1
  • 12
  • 23
  • 1
    Thanks a lot Nandan for your attention to my question, i changed the code, this time Chrome Browser got open but it did not get the address and showed another error. Chrome failed to start: crashed. unknown error: DevToolsActivePort file doesn't exist. (the process started from chrome location c:\users\...\chrome.exe is no longer running, so chromeDriver is assuming that Chrome has crashed.) – Some One Oct 01 '21 at 09:55
  • Uninstall Chrome, deleted everything from c:\Users______\AppData\Local\Google\Chrome\ and installed Chrome again. – Nandan A Oct 01 '21 at 10:11
  • Please refer this https://stackoverflow.com/questions/25311593/chromewebdriver-unknown-error-chrome-failed-to-start-crashed for more details – Nandan A Oct 01 '21 at 10:15
  • 1
    Dear Nandan, I appreciate your kind help so so so much, :) It s working now, i mean both codes. Sub TestSelenium() Dim Mybrowser As Selenium.ChromeDriver Set Mybrowser = New Selenium.ChromeDriver Mybrowser.Start End Sub and Sub TestSelenium() Dim Mybrowser As new webdriver Mybrowser.start "chrome" Mybrowser.get "https://google.com" Application.Wait Now+Timevalue("00:00:20") End Sub You helped me so much ! i deleted all the files and installed chrome again and it s working now. – Some One Oct 01 '21 at 17:23