First of all I want to "HTML" comes in. I have done a tired web-search to complete the task below. (For example,) Problem: In the summary, want to fill a website form (approximately 10 ^ 3 times), enter the question and get each result. To test it and keep it simple, I'm testing it for a price. The VBA code I put together was that what others have done. It opens the new IE window with the desired URL, but it does not fill the "test" permit # (11) and suffix (R) with the desired fields. In I also commented some code "'#" that other methods that a friend suggested me can work that Has been included. Does anyone know what I'm missing ??? Thank you in advance for your help and time!
as dim htmldoc HTMLDocument dim MyBrowser as in InternetExplorer Sub Test (in) dim MyHTML_Element IHTMLElement dim htmldoc HTMLDocument Error Goto Err_Clear MyURL as a string as dim MyURL = "http://www.dwr.state.co.us/wellpermitsearch/" '' 'to open a new Explorer set MyBrowser = new InternetExplorer MyBrowser.Silent = true' MyBrowser.readyState = READYSTATE_COMPLETE set htmldoc = MyBrowser.document 'text Permit number and suffix 'Ready until DoEvents wait loop' page MyBrowser.navigate MyURL MyBrowser.Visible = Navigate to True 'box HTMLDoc.all. TxtPermit.Value = "11" HTMLDoc.all.txtPermitSuf.Value = "R" '# HTMLDoc.getElementById ("txtPermit"). attribute.Value = "11" '# HTMLDoc.getElementById ( "txtPermitSuf") .attribute.Value = "R" in HTMLDoc.getElementsByTagName for each MyHTML_Element ( "input") # If MyHTML_Element.ID = "txtPermit" Then MyHTML_Element .Value = "11" '# If MyHTML_Element.ID = "txtPermitSuf" then MyHTML_Element.Value = "R" MyHTML_Element.Type = "Submit" then MyHTML_Element.Click: out for the next Err_Clear Exit: If err & lt ; & Gt; 0 Then the next end is again Err.Clear End Sub
No comments:
Post a Comment