I have a code in vba that opens a page of ie. I get the html and then I pulse a bonton that is in a popup. That button adds new code to the html of the page, so when added later, I can not access to press another popup button. I need to reload the browser code without reloading the page to not lose that popup and press it. I put the code below. It is a bit urgent, if possible, of course. Thank you very much.
Sub openExplorer()
' --------------------------- VARS IE ---------------------
Dim ie As Object
Dim objDocucment As mshtml.HTMLDocument
Dim State As Integer
'--------------------------- PROGRAM OPEN_IE ---------------------
State = 0
Do Until State = 4
DoEvents
State = ie.readyState
Loop
Set ie = CreateObject("InternetExplorer.Application")
ie.navigate "https://www1.anyWeb.html"
ie.Visible = True
Application.Wait (Now + TimeValue("00:00:15"))
Write #1, "----- Print all html : "
For Each body In ie.Document.getElementsByTagName("body")
Write #1, body.innerHTML
Next
For Each body In ie.Document.getElementsByTagName("button")
If botones.Title = "Si" Then
botones.Click 'This button add new code html
End If
Next
' ----> Load new code html in browser here.
Application.Wait (Now + TimeValue("00:00:05"))
ie.Quit
Set ie = Nothing
End Sub