I'm using VBA and stuck on a way to trigger a Download button in HTML PAGE which inspects below codes:
<input onClick="javascript:__dopostback('GridView1','Accountnumber$0')" type="button" value="Download"></input>
More than one Download button exists on this page and I want to click on the first one.
In these elements the unique Attribute is:
"OnClick=javascript:__dopostback('GridView1','Accountnumber$0')"
But I don't know how to trigger with below VBA:
On Error GoTo Err_Clear
myURL = "Enter your url"
Set MyBrowser = New InternetExplorer
MyBrowser.Silent = True
MyBrowser.Navigate myURL
MyBrowser.Visible = True
Do
Loop Until MyBrowser.ReadyState = READYSTATE_COMPLETE
Set htmlDoc = MyBrowser.Document
htmlDoc.all.txtAccNo.Value = ""
htmlDoc.all.ddlReasons.Value = ""
htmlDoc.all.txtRequester.Value = ""
htmlDoc.all.txtMobNo.Value = ""
htmlDoc.all.txtLandLine.Value = ""
htmlDoc.all.txtEmailAdd.Value = ""
htmlDoc.all.ddlRelation.Value = ""
htmlDoc.all.button1.Click
'**OnClick event required here **
htmlDoc.getElementsByXpath("input[type=""button""]")(0).Click '<--(Not Working)
Err_Clear:
If Err <> 0 Then
Err.Clear
Resume Next
End If



getElementsByXpathisn't in my Microsoft HTML Object Library - is it in yours?