Hi
I'm trying to Automate IE with VBA and am running into an issue I've yet to find a solution to.
My code fails to input the desired text into the text field box. I don't think the code can even find the text box I want it to, it may have someting to do with Javascript and tables. Please take a look and let me know the best method to get this done.
Here is my code.
And here is the Website Source.
I'm trying to Automate IE with VBA and am running into an issue I've yet to find a solution to.
My code fails to input the desired text into the text field box. I don't think the code can even find the text box I want it to, it may have someting to do with Javascript and tables. Please take a look and let me know the best method to get this done.
Here is my code.
Rich (BB code):
Sub Placer_PDF()
Dim IE As Object
Dim url As String
Dim tags As Object
Dim tagx As Object
'load internet explorer
Set IE = CreateObject("internetexplorer.application")
IE.Visible = True
'go to property tax website
url = "https://common3.mptsweb.com/megabyt...aspx?CN=placer&Dept=Tax&Site=Public&PG=Search "
IE.navigate url
'wait for page to load
Do
DoEvents
Loop Until IE.readystate = 4
'Input parcel # into website
IE.Document.all("idAsmt").Value = 44444
'Çlick on the submit button
For Each tagx In tags
If tagx.Name = "Submit" Then
tagx.Click
End If
Next
End Sub
And here is the Website Source.
HTML:
<
b>b>
<
br/>
xmlversion="1.0"encoding="utf-8"?>
DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title>Inquirytitle>******http-equiv="Content-Type"content="text/html; charset=utf-8"/><linkrel="stylesheet"href="../Placer/WebInquiry/CSS/search.css"type="text/css"/><linkrel="stylesheet"href="Placer/WebInquiry/CSS/menus-simple.css"type="text/css"/>********type="text/javascript"language="javascript">script>********type="text/javascript"language="javascript"src="../Placer/WebInquiry/jscripts/ua.js">script>********type="text/javascript"language="javascript"src="../Placer/WebInquiry/jscripts/xbDebug.js">script>********type="text/javascript"language="javascript"src="../Placer/WebInquiry/jscripts/xbDOM.js">script>********type="text/javascript"language="javascript"src="../Placer/WebInquiry/jscripts/xbStyle.js">script>********type="text/javascript"language="javascript"src="../Placer/WebInquiry/jscripts/mbsMenuTree.js">script>********type="text/javascript"language="javascript"src="../Placer/WebInquiry/jscripts/common.js">script>********language="JavaScript"src="../_ScriptLibrary/RS.HTM">script>********language="javascript">script>********type="text/javascript"language="javascript"src="Placer/WebInquiry/jscripts/webinquiry.js">script>head><body><formname="frmMain"method="post"action="Inquiry.aspx?CN=placer&DEPT=Tax&SITE=Public&PG=taxresults"><tablecellspacing="0"cellpadding="0"width="380"><trclass="title"><tdcolspan="3"><i>Tax Inquiry: Please enter search criteriai>td>tr><trclass="titleRollYear"><tdcolspan="2"align="right">
Select Roll Year
td><td><selectname="rollyear"><optionvalue="c">2013 -Current Yearoption><optionvalue="p">2012 -Previous Yearoption>select>td>tr><trclass="tr3search"><tdclass="searchfield">Feeparcel #td><tdclass="searchtype"><selectname="cbfeeparcel"id="idfeeparcel"onchange=""><optionvalue="like">Begins withoption><optionvalue="endwith">Ends withoption><optionvalue="contains">Containsoption><optionvalue="=">Equal tooption><optionvalue="<>">Not equal tooption><optionvalue="<">Less thanoption><optionvalue=">">Greater thanoption>select>td><tdwidth="150"><inputclass="userinput"maxlength="24"onkeypress="js:return SubmitOnEnter(this,event)"name="idfeeparcel">input>td>tr><trclass="tr3search"><tdclass="searchfield">Assessment #td><tdclass="searchtype"><selectname="cbAsmt"id="idAsmt"onchange=""><optionvalue="like">Begins withoption><optionvalue="endwith">Ends withoption><optionvalue="contains">Containsoption><optionvalue="=">Equal tooption><optionvalue="<>">Not equal tooption><optionvalue="<">Less thanoption><optionvalue=">">Greater thanoption>select>td><tdwidth="150"><inputclass="userinput"maxlength="24"onkeypress="js:return SubmitOnEnter(this,event)"name="idAsmt">input>td>tr>table><p><inputtype="button"class="BasicButton"name="Submit"value="Submit"*******="javascript:SubmitForm();"/><inputtype="button"class="BasicButton"name="Clear"value="Clear"*******="javascript:ClearForm();"/><inputtype="hidden"name="edtargs"id="edtargs"value="?CN=placer&DEPT=Tax&SITE=Public">input>p>form>body>html>