how do i click on this button (with no id?)

Status
Not open for further replies.

chuchu

New Member
Joined
Jan 1, 2018
Messages
10
hi team

<button type="button" class="chakra-button css-imdvsq">Add Corporates</button>

i have this button here which i would like to click on to access another screen in VBA. I have no idea how to reference it, would greatly appreciate anybodies help and give extra smile :) faces!

cheers
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Assuming that HTMLDoc represents the html document, try . . .

VBA Code:
    Dim ele As Object
    For Each ele In HTMLDoc.getElementsByClassName("chakra-button css-imdvsq")
        If ele.innerText = "Add Corporates" Then
            ele.Click
            Exit For
        End If
    Next ele

Hope this helps!
 
Upvote 0
Duplicate to: how do i click on this button (with no id?)

In future, please do not post the same question multiple times. Per Forum Rules (#12), posts of a duplicate nature will be locked or deleted.

In relation to your question here, I have closed this thread so please continue in the linked thread.
 
Upvote 0
Status
Not open for further replies.

Forum statistics

Threads
1,214,819
Messages
6,121,729
Members
449,049
Latest member
MiguekHeka

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top