(Solved) – VBA with Internet Explorer

  • by
(solved)-–-vba-with-internet-explorer

Just need to have a better understanding of using the internet explorer object in VBA.
So I want to click the following button with a code as following

OK

My code is as following –

 Dim IE As InternetExplorer 'Reference to Microsoft Internet Controls
 Set IE = New InternetExplorer
 With IE
 .Visible = True
 .Navigate2 "Somewebsite"

 .Document.getelemetbyclass("urBtnEmph").Click

 End With

End Sub

but when I try to run it, it says

‘Object doesn’t support this property or method’.

I’m very new to this internet explorer object and javascript 🙁

Edit:
I had changed the line to ‘ .Document.getelementsbyclass(“urBtnEmph”).Click’ however still have the same warning.

Then I tried this ‘.Document.getElementById(“DLG_VARIABLE_dlgBase_BTNOK”).Click’ and it shows ‘Object variable or with block variable not set’. I had attached the html code for this button

enter image description here

Leave a Reply

Your email address will not be published. Required fields are marked *