Hi,
I'm relatively new to VBA but I am trying to copy data from a website (this website is currently running and will be the same) and paste to defined sheet in Excel. Below is the code that I have thus far, however, I am receiving an error "Method 'ExecWB' of object 'IWebBrowser2' failed".
I'm relatively new to VBA but I am trying to copy data from a website (this website is currently running and will be the same) and paste to defined sheet in Excel. Below is the code that I have thus far, however, I am receiving an error "Method 'ExecWB' of object 'IWebBrowser2' failed".
Code:
Public Sub csi()
Dim appIE As InternetExplorer
Dim xlApp As Excel.Application
Dim wsData As Worksheet
Set xlApp = Application
Set wsData = xlApp.Worksheets("CSIInq")
Set appIE = New InternetExplorer
AppActivate ("Exact Website Title Name Here")
appIE.ExecWB 17, 2 <<--- This line is where the error comes up
appIE.ExecWB 12, 0
AppActivate ("CSI")
Workbooks("CSI.XLS").Activate
Range("A1").Select
ActiveSheet.Paste
Set appIE = Nothing
End Sub
Comment