Click Button in IE with no ID or Name

jdawg_1989

New Member
Joined
Jun 24, 2011
Messages
27
I am trying to click a button on an intranet page.

The html source is as follows:
HTML:
<div id="mainbody">
<div class="buttons">
<a name="a9999" id="a9999"></a>
<input type="button" name="PreviousBtn" *******="javascript:history.back();" value="Previous" title="Previous Page" accesskey="R">
<input type="hidden" name="send">
<input type="Submit" value="Send Form " title="Send Form" accesskey="S" >
</div>
</div>
As you can probably work out there are 2 buttons. "Previous Page" and "Send Form"

I can click the "Previous Page" button just fine using the following code:
Code:
objIE.Document.all("PreviousBtn").Click
The problem I have is trying to click the "Send Form" button as it has no name in the html code.

Any ideas or suggestions please?

Thanks
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Try something like this. Change x and y of course

Code:
objIE.document.forms(x).All.Item(y).Click
 
Upvote 0
You can use something like this.
Code:
objIE.Document.Forms(0).Submit
It assumes there is only one form on the page.
 
Upvote 0

Forum statistics

Threads
1,203,462
Messages
6,055,563
Members
444,799
Latest member
CraigCrowhurst

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