I have a code in VBA that I've always used to open Internet Explorer, copy the information on an specific website and than paste in a cell. The issue now is that the website now is no longer working with IE.
I'm trying to adjust this code to use that with Edge and / or Chrome (I already installed Selenium) but I'm actually struggling with it.
Can someone help me to adjust that code?
Option Explicit
Sub Test()
Dim IE As Object
On Error Resume Next
Application.DisplayAlerts = False
Sheets("Sheet3").Select
Range("A1:A1000") = "" ' erase previous data
Range("A1").Select
Set IE = CreateObject("InternetExplorer.Application")
With IE
.Visible = True
.Navigate "https://google.com" ' should work for any URL
Do Until .ReadyState = 4: DoEvents: Loop
End With
IE.ExecWB 17, 0 '// SelectAll
IE.ExecWB 12, 2 '// Copy selection
ActiveSheet.PasteSpecial Format:="Text", link:=False, DisplayAsIcon:=False
Range("A1").Select
IE.Quit
Application.DisplayAlerts = True
End Sub
How I switch the IE mentions to a Edge or Chrome one? For instance, change IE to objEdge, etc..