Sharid
Well-known Member
- Joined
- Apr 22, 2007
- Messages
- 1,064
- Office Version
- 2016
- Platform
- Windows
This code was work fine, for the large part. meaning it did not fully do what i wanted but no errors popped up.
Now I get a Method 'Busy' of object 'IWebBrowser2' Failed error message
Not sure what has gone wrong, it was error free 20min ago
Private Sub CommandButton1_Click()
' +++++++++++++++ FOR url extraction ++++++++++++++++
Dim ie, items, elem As Object
Dim i, j, k, l As Integer
i = 2
k = 2
l = 2
Set ie = CreateObject("InternetExplorer.Application")
ie.Navigate Sheets("Sheet2").Range("A1").Value
ie.Visible = True
Application.Wait (Now + TimeValue("00:00:10"))
Do While ie.busy Or ie.readyState <> 4
Loop
For i = 0 To 500
On Error Resume Next
Sheets("Sheet1").Range("A" & i).Value = ie.document.getelementsbytagname("a").Item(i).innerText
Next i
ie.Visible = Quit
' Deletes duplicates in column A
Columns(1).RemoveDuplicates Columns:=Array(1)
End Sub
For more info on what the code does see my original thread https://www.mrexcel.com/forum/excel-questions/1040144-url-search.html
Now I get a Method 'Busy' of object 'IWebBrowser2' Failed error message
Not sure what has gone wrong, it was error free 20min ago
Private Sub CommandButton1_Click()
' +++++++++++++++ FOR url extraction ++++++++++++++++
Dim ie, items, elem As Object
Dim i, j, k, l As Integer
i = 2
k = 2
l = 2
Set ie = CreateObject("InternetExplorer.Application")
ie.Navigate Sheets("Sheet2").Range("A1").Value
ie.Visible = True
Application.Wait (Now + TimeValue("00:00:10"))
Do While ie.busy Or ie.readyState <> 4
Loop
For i = 0 To 500
On Error Resume Next
Sheets("Sheet1").Range("A" & i).Value = ie.document.getelementsbytagname("a").Item(i).innerText
Next i
ie.Visible = Quit
' Deletes duplicates in column A
Columns(1).RemoveDuplicates Columns:=Array(1)
End Sub
For more info on what the code does see my original thread https://www.mrexcel.com/forum/excel-questions/1040144-url-search.html
Last edited: