• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

f8 works but not in runtime, code skips in vba

I am clueless, i have code that will do some form entering, it was working perfectly, suddenly it started to skip some code, When i run it through F8 (Step by step), it works perfectly, when i run it, it showing error, any suggestion, Here is my code,
Code:
Dim ie AsObjectSet ie = CreateObject("InternetExplorer.Application")With ie
.Visible =True.navigate ("http://datastore.netronline.com/Default.aspx")EndWith

While ie.ReadyState <>4
DoEvents
Wend

Set sel = ie.Document.getElementById("CountySelector_State_State")IfNot sel IsNothingThen
sel.Value =6
sel.FireEvent "onchange"EndIfDoWhile ie.busy: DoEvents:Loop

Set sel1 = ie.Document.getElementById("CountySelector_County_County")IfNot sel1 IsNothingThen
sel1.Value =217
sel1.FireEvent "onchange"EndIfDoWhile ie.busy: DoEvents:Loop

Set sel2 = ie.Document.getElementById("ProductPick_ProductDropDown_Products")IfNot sel2 IsNothingThen
sel2.Value =6EndIfDoWhile ie.busy: DoEvents:Loop

Set form = ie.Document.getElementById("ProductPick_Submit")
form.Click
DoWhile ie.busy: DoEvents:Loop

Set form1 = ie.Document.getElementById("ViewSearch_SearchTypes_ctl01_SearchHolderImage")
form1.Click
DoWhile ie.busy: DoEvents:Loop

Set sel3 = ie.Document.getElementById("ViewSearch_SearchTypes_ctl01_SearchFieldsDisplay_SearchFields_ctl00_SearchField_apn")

IfNot sel3 IsNothingThen
sel3.Value = Sheet1.Cells(ActiveCell.Row,"A")EndIfDoWhile ie.busy: DoEvents:Loop

Set form2 = ie.Document.getElementById("ViewSearch_SearchTypes_ctl01_SearchFieldsDisplay_Search")
form2.Click
DoWhile ie.busy: DoEvents:Loop
 
Back
Top