I work with vba in excel 2010 and Internet Explorer 8 and Vista. The code below works to go to the remote website and publish the form. On the final page, the code should click the "Get Grades" button. Instead, I get this error "object variable or with non-blocking variable". The highlighted problematic line in the code is "evaluation = ieApp.document.getElementById (" btnRequestEstimates ")".
I think part of the problem might be that a button that doesn't work is a submit button that is not part of the form. I am also wondering if the variables should be reset before pressing the second button. The error message implies that this is a qualification problem, but I consider this a fairly standard way of qualifying an element in this situation. These are some of the things I searched on Google, but I'm not sure what the problem is.
Sub btn_version() Dim ieApp As Object Dim ieDoc As Object Dim ieForm As Object Dim ieObj As Object Dim URL As String Dim estimate As Object URL = "http://www.craft-e-corner.com/p-2688-new-testament-cricut-cartridge.aspx" Set ieApp = CreateObject("InternetExplorer.Application") ieApp.Visible = True ieApp.navigate URL While ieApp.Busy Or ieApp.readyState <> 4: DoEvents: Wend Set ieDoc = ieApp.document Set ieForm = ieDoc.forms(1) For Each ieObj In ieForm.Elements If ieObj.ClassName = "AddToCartButton" Then ieObj.Click End If Next ieObj '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' While ieApp.Busy Or ieApp.readyState <> 4: DoEvents: Wend estimate = ieApp.document.getElementById("btnRequestEstimates") estimate.submit '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' End Sub
source share