I'm trying to click toggle button using vba code. I have navigated webpage on webbrowser. below is the HTML code for toggle button
< td >< input type='button' id='ToggleButton' name='ToggleButton' value='Expand All' style='width:100px' ******* =' ToggleAllVisStatus (this) ' < / td >
Please help me with the vba code to click toggle button.
I have tried below code but not working..
Set doc1 = UserForm1.WebBrowser1.Document
For Each element1 In doc1.all
If InStr(1, element1.tagName, "BUTTON") > 0 Then
Set btn = element1
If Trim(btn.innerText) = "Expand All" Then
btn.Click
Exit For
End If
End If
Next
< td >< input type='button' id='ToggleButton' name='ToggleButton' value='Expand All' style='width:100px' ******* =' ToggleAllVisStatus (this) ' < / td >
Please help me with the vba code to click toggle button.
I have tried below code but not working..
Set doc1 = UserForm1.WebBrowser1.Document
For Each element1 In doc1.all
If InStr(1, element1.tagName, "BUTTON") > 0 Then
Set btn = element1
If Trim(btn.innerText) = "Expand All" Then
btn.Click
Exit For
End If
End If
Next