On webUI, it is unable to click second button after first click in VBA?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Gabbar
    New Member
    • Sep 2015
    • 2

    #1

    On webUI, it is unable to click second button after first click in VBA?

    It doesn't have id element into second button elements except type, value and onclick;

    Below is my webUI code

    Code:
     
    <input type="button" value="Download onclick="javascript:__doPostBack('GridView1','Account_number$0')">
    Below is my VBA code

    Code:
    Dim htmlDoc As HTMLDocument 
    Dim MyBrowser As InternetExplorer  
    Dim MyHTML_Element As IHTMLElement  
    Dim myURL As String  
    
    On Error GoTo Err_Clear  
    myURL = "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 = "0" & "" & TextBox2.Value 
    htmlDoc.all.ddlReasons.Value = "1"
    htmlDoc.all.txtRequester.Value = TextBox3.Text 'Enter your password here
    htmlDoc.all.txtMobNo.Value = "0" & "" & TextBox1.Value
    htmlDoc.all.txtLandLine.Value = ""
    htmlDoc.all.txtEmailAdd.Value = Range("E15")
    htmlDoc.all.ddlRelation.Value = "3"
    htmlDoc.all.button1.Click
    error in blow script of second button
    Code:
     
    htmlDoc.getElementsByXpath("input[type=""button""]").Click
    Please help me, how to automate second JS button?
Working...