locked
VBA - Web Automation - Need to click on image like button RRS feed

  • Question

  • Hi All, I am trying to automate an internal web page.  I am unable to click on 'SAVE' button at the end which is actually an image like button.  Please help me on this.



    Here is the VBA Code::::

    Sub ChangePriority()

        Dim IE As New SHDocVw.InternetExplorer
        Dim X As Integer
        Dim Numrows As Integer

        Numrows = Range("A2", Range("A1").End(xlDown)).Rows.count


        Range("A1").Select
        For X = 1 To Numrows
            IE.Visible = True
            IE.navigate "http://prod.ciqhyd.com/CDRM/Reissue_ChangePriority.aspx"

            Do While IE.ReadyState <> READYSTATE_COMPLETE
            Loop

            IE.Document.forms("RCForm").elements("ucSearchFilings_rblInputBox_0").Click
            IE.Document.forms("RCForm").elements("ucSearchFilings$tbInput").Value = ActiveCell.Offset(X, 0).Value ' FF ID from A2 onwards

            Do While IE.Busy = True Or IE.ReadyState <> 4: DoEvents: Loop
            IE.Document.forms("RCForm").elements("ucSearchFilings$btnGo").Click


            On Error GoTo vgolla

            Do While IE.Busy = True Or IE.ReadyState <> 4: DoEvents: Loop
            Application.Wait (Now + TimeValue("00:00:02"))
            IE.Document.forms("RCForm").elements("ucSearchFilings_gvFFilingsReissuePriority_ChangePriority_0").Click

            Do While IE.ReadyState <> READYSTATE_COMPLETE
            Loop

            IE.Document.forms("RCForm").elements("ucSearchFilings_gvFFilingsReissuePriority_tbChangePriorityComment_0").Value = ActiveCell.Offset(X, 1).Value 'Comment for checkbox


            'Here SAVE button need to select       
             IE.Document.getElementsByTagName("form")(0).Click



            ActiveCell.Offset(X, 2).Value = "Customer request assigned"
        Next
    vgolla:
            ActiveCell.Offset(X, 2).Value = "Enter a valid input / You dont have permission to do this"
            MsgBox "Enter valid FFID / You dont have permission", vbOKCancel, vbQuestion

    End Sub

    =====

    HTML Code::

    <table style="width: 1035px">
    <tbody>
    <tr>
    <td width="100%" aligh="center">
    <input name="ucSearchFilings$ibSave" id="ucSearchFilings_ibSave" style="HEIGHT: 20px" onclick="javascript:return highlite();WebForm_DoPostBackWithOptons(new WebForm_PostBackOptons ("ucSearchFilings$ibSave", "", true, "koundinya", false,false))" type="image" src="Images/button1D2.jpg"></input>
    </td>
    </tr>
    </tbody>
    • Edited by vgolla Wednesday, February 19, 2020 5:22 PM
    Wednesday, February 19, 2020 5:19 PM