Close security screen alert Internet Explorer Pop-up using VBA and Windows API

56 Views Asked by At

I´ve been devoloping an automation with VBA that uses Internet Explorer as the main browser. But every time I run my code, a little screen appear, saying about security: it´s in portuguese but i don´t think the content is important.

I don´t know exactly if there´s any way deactivate the message, but this solution will be useless, becasue the code is itended to run on other computers.

One solution that I had founded was to "sending keys" like: SendKeys ("~") But with this method maybe can happend so many issues. So I had the idea to take the handdle screen code or HWND and use it with the windows API function SendMessage to close it:

Declare PtrSafe Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As LongPtr, ByVal wMsg As Long, ByVal wParam As LongPtr, lParam As Any) As LongPtr

Perhaps I don´t know how to take the hwnd from this screen because it seems to be a just pop-up

as my code and generic i won´t put it here

I readed some other post but any of them helped me to solve

0

There are 0 best solutions below