Hello BByrd,
This macro can be run after you have started Internet Explorer. It will find the form named "reportForm" , locate the input button "Download" and then click the button for you. The macro will inform you if either the form or button can not be found.
' Thread: http://www.excelforum.com/excel-programming/808002-submit-ie-form-with-same-name-different-values.html
' Poster: BByrd
' Written: January 04, 2012
' Author: Leith Ross
Sub ClickDownloadButton()
Dim btn As Object
Dim frm As Object
Dim Found As Boolean
Dim ieApp As Object
Dim ieDoc As Object
Dim ieForms As Object
Dim ieBtns As Object
Dim Shell As Object
Set Shell = CreateObject("Shell.Application")
Set ieApp = Shell.Windows(0)
Set ieDoc = ieApp.Document
Set ieForms = ieDoc.getElementsByTagName("form")
For Each frm In ieForms
If frm.Name = "reportForm" Then
Found = True: Exit For
End If
Next frm
If Not Found Then
MsgBox "The Form ""reportForm"" was not found in this document.", vbCritical
Exit Sub
End If
Set ieBtns = frm.getElementsByTagName("input")
For Each btn In ieBtns
If btn.Value = "Download" Then
btn.Click: Exit Sub
End If
Next btn
MsgBox "The Input Button ""Download"" was found on this Form.", vbCritical
End Sub
Bookmarks