I am having a problem with a particular section of code in a project I'm working on. The total code for the Sheet is extensive, so I'm only posting the small bit that's relevant to the problem at hand.
The goal is to copy a particular cell, call a particular *already running* Internet Explorer window (there are generally three different instances of IE running at any given time), find the proper text box that the cell's information goes in (the Account Number field), and fill the textbox with the information from the clipboard. Ideally the macro would then click the submit button, but I'll cross that bridge when I come to it. When the designated trigger cell is clicked, my macro works perfectly at copying the information cell and calling the proper window.
However, it continually gives me an Object Required error and highlights the line below that I marked. I have tried numerous formats of code for that line, some short, some long, some simple, some extensive. No matter what I do, I keep coming back to the same error. I could be wrong, but I was sure that "pan" is the proper name for the box I need, but I guess I could be wrong. Out of 1500 lines of source code, I'm pretty sure I copied the relevant portion.
This is probably a simple error on my part, but it's been vexing me for days. Any help would be greatly appreciated.
Relevant VBA Code:
If Target.Address = "$N$1:$O$1" Then
Range("$C$1").Copy
AppActivate ("Proprietary Window Name")
IE.document.all("pan").Value = "4"<--------PROBLEM LINE
End If
Relevant Page Source Code:
</< font>td>
<tdcolspan="3" height="75" >
<tableborder="0" cellspacing="0" cellpadding="0" width="100%" height="100%" role="presentation" >
<trheight="40%" valign="bottom">
<tdwidth="5%"> </< font>td>
<tdcolspan="2" align='left' >
<labelfor="pan"><spanclass="BodyText">Account Number:</< font>span><label>
</< font>td>
</< font>tr>
<trvalign="top">
tdwidth="5%"> </< font>td>
<tdwidth="30%" valign="top" height="50%" align='left' >
<inputtype="text" maxlength="16" name="pan" id="pan" value="">
</< font>td>
<tdalign='left' valign="top">
<span> </< font>span>
<inputtype="button" name="button_get_trx_list_by_pan" value="Go" *******="javascript:NewSubmitForm('get_pan');">
</< font>td>
</< font>tr>
</< font>table>
</< font>td>
The goal is to copy a particular cell, call a particular *already running* Internet Explorer window (there are generally three different instances of IE running at any given time), find the proper text box that the cell's information goes in (the Account Number field), and fill the textbox with the information from the clipboard. Ideally the macro would then click the submit button, but I'll cross that bridge when I come to it. When the designated trigger cell is clicked, my macro works perfectly at copying the information cell and calling the proper window.
However, it continually gives me an Object Required error and highlights the line below that I marked. I have tried numerous formats of code for that line, some short, some long, some simple, some extensive. No matter what I do, I keep coming back to the same error. I could be wrong, but I was sure that "pan" is the proper name for the box I need, but I guess I could be wrong. Out of 1500 lines of source code, I'm pretty sure I copied the relevant portion.
This is probably a simple error on my part, but it's been vexing me for days. Any help would be greatly appreciated.
Relevant VBA Code:
If Target.Address = "$N$1:$O$1" Then
Range("$C$1").Copy
AppActivate ("Proprietary Window Name")
IE.document.all("pan").Value = "4"<--------PROBLEM LINE
End If
Relevant Page Source Code:
</< font>td>
<tdcolspan="3" height="75" >
<tableborder="0" cellspacing="0" cellpadding="0" width="100%" height="100%" role="presentation" >
<trheight="40%" valign="bottom">
<tdwidth="5%"> </< font>td>
<tdcolspan="2" align='left' >
<labelfor="pan"><spanclass="BodyText">Account Number:</< font>span><label>
</< font>td>
</< font>tr>
<trvalign="top">
tdwidth="5%"> </< font>td>
<tdwidth="30%" valign="top" height="50%" align='left' >
<inputtype="text" maxlength="16" name="pan" id="pan" value="">
</< font>td>
<tdalign='left' valign="top">
<span> </< font>span>
<inputtype="button" name="button_get_trx_list_by_pan" value="Go" *******="javascript:NewSubmitForm('get_pan');">
</< font>td>
</< font>tr>
</< font>table>
</< font>td>