The below code is providing a "Loop without do error" while I have my very simple do while statement. Code runs without it, however will not loop through the 100 rows I am extracting data from.
Its clear that the issue is a result of the readystate dowhile (as code will run if I comment this out), but I am not sure of the mechanics of this working without this for IE.
Is anyone able to explain what additional(?) line of code I need to add to stop this error?
Do While i < 100
Set ie = CreateObject("InternetExplorer.Application")
With ie
.Navigate URLStart
.Visible = True
Do While .ReadyState <> 4: DoEvents: Loop
Set doc = ie.Document
With doc
LicenceNO = "whatever"
ActiveSheet.Range("C" & i).Value = LicenceNO
LicenceName = "whatever"
ActiveSheet.Range("D" & i).Value = LicenceName
BusinessAddress = "whatever"
ActiveSheet.Range("E" & i).Value = BusinessAddress
AATOCategory = "whatever"
ActiveSheet.Range("F" & i).Value = AATOCategory
End With
i = i + 1
Loop
Thanks all!
With ieblock.99, not until100. If you need to go to100then use<=instead of<