0

Using a VB script (via Excel), I am working on automating some data entry into an IE web page. I have successfully been able to use ".getElementById("WhateverID").Click" in most instances. However, there is a plus sign button that has not been responding to the Click command. Here is what the button ("btnAddAction") looks like: Add Action

Upon clicking the Add Action button, two new buttons appear ("btnSaveAction" and "btnCancelAction"): Save Action & Cancel Action

Any suggestions on how to get this Add Action button to respond with this code: objIE.document.getElementById("btnAddAction").Click

Here is the web inspection code:

<section class="placement-update" id="DecisionUpdate">
    <div style="display: block;">
        <nav class="navbar navheading blueBar">
            <h5 class="heading"> Decision Update</h5>
            <div class="ml-auto crd_save">
                <img tabindex="-32768" class="pointer" id="btnSaveAction" style="display: inline;" src="/images/save.svg">
            </div>

            <div class="edit">
                    <img tabindex="-32768" class="pointer" id="btnAddAction" style="display: none;" src="/images/add.svg">
                <img tabindex="-32768" class="pointer" id="btnCancelAction" style="display: inline;" src="/images/cancel.svg">
            </div>
        </nav>
BigBen
  • 46,229
  • 7
  • 24
  • 40
Hazzie
  • 1
  • VBA and VBScript are different, removed the VBScript tag. – BigBen Sep 16 '20 at 14:54
  • There is a very similar question dealing with using VB to get an element by ID, and "clicking" in excel. The approved answer might give you some direction. – tengen Sep 16 '20 at 15:44
  • Is there any error when you click the button? Is the button in an iframe? You can also check if there's any onclick function in the `btnAddAction` button. If so, you can also fire the onclick function directly to get the button responding. – Yu Zhou Sep 17 '20 at 08:49
  • There is no debug error with: objIE.document.getElementById("btnAddAction").Click However, the visible result of the click action is not happening. Upon clicking, a number of editable fields become available allowing for the subsequent clicking of the Save Action or Cancel Action buttons. – Hazzie Sep 17 '20 at 12:20
  • I suggest you try to change the classes of the elements to make them available to simulate the click function. You can refer to [my answer](https://stackoverflow.com/questions/63677723/excel-ie-automation-identifying-a-css-element/63680823#63680823) in this thread which uses the same idea. I think you'll know how to try after referring to it. – Yu Zhou Sep 18 '20 at 09:00

0 Answers0