Using Chrome Browser instead of InternetExplorer.Application
I know how to work with Excel VBA and IE, but I would like to know if it is possible to work with Google Chrome, as I find it faster than IE.
Here's what I mean specifically:
Set IE = CreateObject("InternetExplorer.Application")
Could this be replaced with something that launches Chrome instead of IE?
source to share
Google Chrome does not provide a Visual Basic interface like Internet Explorer, so you cannot access any of its properties (for example Document
). You can run chrome at a specific address by simply passing in the executable.
For example:
Dim path As String = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles)
Dim executable As String = Path.Combine(path, "Google\\Chrome\\Application\\chrome.exe")
Process.Start(executable, "http://google.com")
source to share
There's a great resource library called Selenium that has VBA Wrappers. There is a very simple tutorial here, although if you really want to do something, a better starting point is the example table posted here .
source to share
I've tried using the Selenium wrapper in Chrome or Firefox several times with no success. The developer suggested that I update my browser, but it did not help, it seems that selenium has not been updated for a long time and does not work very painfully, because the web has developed a lot on many sites, unfortunately, they do not provide the full capabilities of IE
source to share