Hi, I am making a VBA code to open a site to get some data and need help.
Its a intranet site
The site has a certifical error, so every time we open the site, we have to click on proceed to site anyway.
The site then have a agree button for terms and conditions.
Code I used is as below.
Ms internet controls and ms HTML references are added.
When I run this, a new ie opens and I am directed to I Agree page, which means proceed to site is working.
But for some reason its not able to click on I Agree
Please help
Its a intranet site
The site has a certifical error, so every time we open the site, we have to click on proceed to site anyway.
The site then have a agree button for terms and conditions.
Code I used is as below.
Ms internet controls and ms HTML references are added.
Code:
Dim ie as new shwdoc.internetexplorer
Dim htmldoc as mshtml.htmldocument
Dim htmlinput as mshtml.ihtmlelement
ie.visible = true
is.navigate "site name"
Do while readystate <> readystate complete
Loop
Set htmldoc = ie.document
'For clicking proceed to site
Set htmlinput = htmldoc.getelementbyid("override")
htmlinput.Click
'For clicking I Agree
Set htmlinput = htmldoc.getelementbyid("btnagree")
htmlinput.Click
End sub
When I run this, a new ie opens and I am directed to I Agree page, which means proceed to site is working.
But for some reason its not able to click on I Agree
Please help