Dear all,
I am trying to do IE Automation through Excel VBA code.
I have a web page which has Top, Middle and Results forms. I need to input values in the Middle form(Not sure whether it is FORM or FRAME or DOCUMENT) but unable to get any controls from this and get it as 0. Ie.Document.forms.Length gives 0. Tried the below code as well but does not work.
Ie.Document.forms("SearchForm").elements("PolicyNumber").Value = "Josh"
Looks like this form is on a frame but don't see frame reference inthe HTML code. HTML code is as below:
Top Frame: It has the Header and Menu
<HTML>
<HEAD>
<TITLE>Header Form</TITLE>
****** http-equiv=Content-Type content="text/html">
<LINK rel=STYLESHEET href="css/style.css" type="text/css">
******** type="text/javascript" language="javascript" src="/cciv/css/AigagAjax.js">*********>
******** language="JavaScript" type="text/javascript" src="/cciv/css/Contact.js">*********>
******** language="JavaScript">
Middle Frame: This is place where I need to input value in PolicyNumber and click on Submit.
<body bgcolor="white">
<form method=POST name="SearchForm" action="PolicySearch" target="resultframe" >
<input type=hidden name="NewSearch" value="True" ></input>
<table class=box2 cellpadding="1" cellspacing="0" border="0" width="760" align="top" halign="left">
<tr>
<td class="name" align="left">Policy# :<input type=text name="PolicyNumber" maxlength="10" value="" size="10"></input></td>
<td class="name" align="left">
<input class="name" type=radio name="SearchParty" value="Insured" checked></input>Insured
<input class="name" type=radio name="SearchParty" value="Owner" ></input>Owner
<input class="name" type=radio name="SearchParty" value="Payor" ></input>Payor</td>
<td class="name" align="left">SSN: <input type=text name="SSN" maxlength="9" value="" size="9"></input></td>
<td class="name" align="left"><INPUT class="SubmitButton" name="SearchSubmit" width=9 value="Search" type="submit" *******="if (parent.resultframe.displayWaitMessage) {return parent.resultframe.displayWaitMessage();} "></INPUT></td>
</tr>
<tr>
<td nowrap class="name" align="left" >Agent# :<input type=text name="AgentNumber" maxlength="10" value="" size="10"></input></td>
<td nowrap class="name" align="left">Name (Last,First): <input type=text name="PartyName" maxlength="20" value="" size="15" ></input></td>
<td nowrap class="name" align="left">DOB: <input type=text name="DOB" maxlength="10" onFocus="if(value == 'mm-dd-yyyy') {value = ''}" onBlur="isValidDate()" value="mm-dd-yyyy" size="10"></input></td>
<td nowrap class="name" align="left"><INPUT class="SubmitButton" width=9 value="Clear " type=reset></INPUT></td>
</tr>
</table>
</form>
</body>
</html>
Please help since I am newbie in IE Automation through Excel and also newly register in this Forum. Appreciate your immediate help and support.
Thanks,
Josh
I am trying to do IE Automation through Excel VBA code.
I have a web page which has Top, Middle and Results forms. I need to input values in the Middle form(Not sure whether it is FORM or FRAME or DOCUMENT) but unable to get any controls from this and get it as 0. Ie.Document.forms.Length gives 0. Tried the below code as well but does not work.
Ie.Document.forms("SearchForm").elements("PolicyNumber").Value = "Josh"
Looks like this form is on a frame but don't see frame reference inthe HTML code. HTML code is as below:
Top Frame: It has the Header and Menu
<HTML>
<HEAD>
<TITLE>Header Form</TITLE>
****** http-equiv=Content-Type content="text/html">
<LINK rel=STYLESHEET href="css/style.css" type="text/css">
******** type="text/javascript" language="javascript" src="/cciv/css/AigagAjax.js">*********>
******** language="JavaScript" type="text/javascript" src="/cciv/css/Contact.js">*********>
******** language="JavaScript">
Middle Frame: This is place where I need to input value in PolicyNumber and click on Submit.
<body bgcolor="white">
<form method=POST name="SearchForm" action="PolicySearch" target="resultframe" >
<input type=hidden name="NewSearch" value="True" ></input>
<table class=box2 cellpadding="1" cellspacing="0" border="0" width="760" align="top" halign="left">
<tr>
<td class="name" align="left">Policy# :<input type=text name="PolicyNumber" maxlength="10" value="" size="10"></input></td>
<td class="name" align="left">
<input class="name" type=radio name="SearchParty" value="Insured" checked></input>Insured
<input class="name" type=radio name="SearchParty" value="Owner" ></input>Owner
<input class="name" type=radio name="SearchParty" value="Payor" ></input>Payor</td>
<td class="name" align="left">SSN: <input type=text name="SSN" maxlength="9" value="" size="9"></input></td>
<td class="name" align="left"><INPUT class="SubmitButton" name="SearchSubmit" width=9 value="Search" type="submit" *******="if (parent.resultframe.displayWaitMessage) {return parent.resultframe.displayWaitMessage();} "></INPUT></td>
</tr>
<tr>
<td nowrap class="name" align="left" >Agent# :<input type=text name="AgentNumber" maxlength="10" value="" size="10"></input></td>
<td nowrap class="name" align="left">Name (Last,First): <input type=text name="PartyName" maxlength="20" value="" size="15" ></input></td>
<td nowrap class="name" align="left">DOB: <input type=text name="DOB" maxlength="10" onFocus="if(value == 'mm-dd-yyyy') {value = ''}" onBlur="isValidDate()" value="mm-dd-yyyy" size="10"></input></td>
<td nowrap class="name" align="left"><INPUT class="SubmitButton" width=9 value="Clear " type=reset></INPUT></td>
</tr>
</table>
</form>
</body>
</html>
Please help since I am newbie in IE Automation through Excel and also newly register in this Forum. Appreciate your immediate help and support.
Thanks,
Josh