While Me.WebBrowser1.Busy Or Me.WebBrowser1.ReadyState <> 4 DoEvents Wend
iLastRow = Cells(Rows.Count, "a").End(xlUp).Row For Each Rng In Range("a2:a" & iLastRow) If Not Rng.Value = vbNullString Then Rng.Select Me.WebBrowser1.Document.getElementById("applNumber").Value = Rng.Value Me.WebBrowser1.Document.getElementById("btnView").Click x = vbNullString Do On Error Resume Next x = Me.WebBrowser1.Document.getElementsByTagName("td")(0).innerHTML On Error GoTo 0 DoEvents Loop While x <> "(NOT FOR LEGAL USE)" For i = 0 To Me.WebBrowser1.Document.getElementsByTagName("td").length If Me.WebBrowser1.Document.getElementsByTagName("td")(i).innerHTML Like "*Status*" Then Txt = Me.WebBrowser1.Document.getElementsByTagName("td")(i).innerHTML Exit For End If Next Txt = StripHTML(Txt) Txt = Replace(Txt, " ", vbNullString) Txt = Replace(Txt, "Status :", vbNullString)
ActiveCell.Offset(0, 1).Select ActiveCell.Value = Txt Me.WebBrowser1.navigate "http://124.124.193.235/eregister/viewdetails.aspx" While Me.WebBrowser1.Busy Or Me.WebBrowser1.ReadyState <> 4 DoEvents Wend