Hi everyone!
Use the following a code to automatically open approx 5,000 links and frequently IE remains busy, thereby blocking the process.
I'm interested in a code that give refresh after 10 seconds if IE is not ready.
All the best!
Use the following a code to automatically open approx 5,000 links and frequently IE remains busy, thereby blocking the process.
Code:
Sub GetTable()
Dim ieApp As InternetExplorer
Dim ieDoc As Object
Dim ieTable As Object
Dim clip As DataObject
'create a new instance of ie
Set ieApp = New InternetExplorer
'you don’t need this, but it’s good for debugging
ieApp.Visible = True
'assume we’re not logged in and just go directly to the login page
vAddr = ActiveCell.Hyperlinks(1).Address
ieApp.Navigate vAddr
Do While ieApp.Busy: DoEvents: Loop
Do Until ieApp.ReadyState = READYSTATE_COMPLETE: DoEvents: Loop
'copiaza continutul paginii
Application.CutCopyMode = False
ieApp.ExecWB OLECMDID_SELECTALL, OLECMDEXECOPT_DODEFAULT
ieApp.ExecWB OLECMDID_COPY, OLECMDEXECOPT_DODEFAULT
Sheets("Sheet2").Select
With ActiveSheet
LastCol = .Cells(3, .Columns.Count).End(xlToLeft).Column
End With
h = LastCol + 1
Cells(1, h).Select
ActiveSheet.PasteSpecial Format:="Unicode Text", Link:=False, _
DisplayAsIcon:=False
Sheets("Sheet1").Select
'close 'er up
ieApp.Quit
Set ieApp = Nothing
End Sub
I'm interested in a code that give refresh after 10 seconds if IE is not ready.
All the best!