Dale Kalsow
dkalsow at yahoo.com
Fri Nov 1 14:51:05 CDT 2013
I have written some code in vba in excel. The code opens a web site and from data in the spreadsheet fills in the same web form from each row of data. If the web form does not come back with any data, the vba code closes it. However, if it does find some data, it is supposed to leave the web form open. The leaving it open part is not working. Instead it throws an error. Can anyone help me fix the error? The error is: Run-time error '91': Object variable or With block variable not set. I am getting this error in the following block of code i = 0: blnLoop = True: intI = objCollection.Length While blnLoop MsgBox (objCollection(i).classname) If objCollection(i).classname = "NoResultsSummaryText" Then IE.Quit blnLoop = False End If i = i + 1 If i >= intI Then blnLoop = False Wend specifically on the: If objCollection(i).classname = "NoResultsSummaryText" Then line of code. Does anyone see how I can fix this? Thanks! Dale