0
Hello, I have a VBA code that accesses a web page and deletes the entries.
The moment I click the button "delete item" opens an alert on the screen with two buttons ("okay" and "Cancel") and displaying the message "confirm the exclusion of the place of delivery?"
I wanted to know how I do to click the button "okay".
Follows excerpt from the code:
For Each elements In IE.Document.getElementsByTagName("input")
If elements.name = "quantidadeTotalInformada" Then
quantidaeTotal = elements.Value
End If
Next
If quantidaeTotal > 0 Then
For Each element In IE.Document.getElementsByTagName("a")
If element.innertext = "Selecione" Then
element.Click
Exit For
End If
Next
'o popup aparece depois de clicar neste botão
IE.Document.getElementById("id_btnExcluirLocal").Click
End If
not manjo vba but I’ve been seeing around IE.Document.Forms(0). Submit and something like IE.Document.getelementsbyname("subAction")(0). Click
– user60252
I found a way using the Findwindow() to find the popup and the Sendkeys() to send the button click command "okay".
– Daniel Aristofanes
but there is a problem, after I click the delete button (IE.Document.getElementById("id_btnExcluirLocal"). Click), the popup appears and the code hangs and only continues if I click (with the mouse), on "okay" or "gate"
– Daniel Aristofanes
after waiting a few minutes excel shows the message "microsoft excel is waiting for another application to complete the OLE action "
– Daniel Aristofanes
Try giving a Sendkeys to see if it solves
– Moacir
Sendkeys even finds the alert that opens it... however if the macro triggers the button "id_btnExcluirLocal" the ie locks the execution of the code and only release if I manually click ok or close the alert
– Daniel Aristofanes