Skip to content Skip to sidebar Skip to footer

Use Vba Code To Click On A Button On Webpage

I am editing a vba program and want to code the vba to click on a button in a webpage. The html for the button is: Copy

Where wb is the WebBrowser control.

Solution 2:

Is there a reason you couldn't give the element an id?

i.e.:

<inputid='myButton'type=imagesrc="/lihtml/test_button3.gif"align=leftalt=File_Certificate_Go>

then:

document.getElementById('myButton').click()

edit: Based on your comment, you'd have to grab all input elements on the page, and then cycle through them looking for the one that makes your input unique:

var elms = document.getElementsByTagName("input"); 
for (var i=0; i< elms.length; i++) 
    if(elms[i].src = '/lihtml/test_button3.gif') { elms[i].click(); }

Something along those lines anyway

Post a Comment for "Use Vba Code To Click On A Button On Webpage"