Run-Time Error '424': Object Required

JennaR

New Member
Joined
Feb 8, 2015
Messages
22
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>
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
What is IE? is this an application event? It doesn't appear to be a proper object as in the words "document" and "all" are not in capitals
or does it simply stand for Internet Explorer

Dim IE As Object

' Create InternetExplorer Object
Set IE = CreateObject("InternetExplorer.Application")
 
Upvote 0
^That wasn't meant to be a hyperlink. I just copied it from a page I was researching the issue at.
 
Upvote 0

Forum statistics

Threads
1,216,107
Messages
6,128,869
Members
449,475
Latest member
Parik11

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top