Warnings on Web Pages

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How does one turn off warnings on a web page opened through an Excel Macro.

I get the "warning you are about to be redirected to a connection that is
not secure" and I want it to just stop showing me that when I open the
webpage, because it halts the macro. Can this be done?

Thanks!!!

Code used to open the webpage:

Function Get_Online_Report()

Application.DisplayAlerts = False

Dim ie As Object
Set ie = CreateObject("InternetExplorer.Application")
With ie
.Visible = True
.navigate "http://siteaddresshere"
Do Until .readystate = 4
DoEvents
Loop
With .Document.Forms(0)
.Item("UserName").Value = "Your UserName Here"
.Item("Password").Value = "Your Password Here"
.Item("Submit").Click
End With
End With
Set ie = Nothing
End Function


So when I get to the .Item("Submit").Click, it halts the macro and states
"You Do Not Have Permission" and I am hunching that it has something to do
with the warning. Or am I way off?
 
ALSO, I wanted to know what the code looks like to close the webpage once
done with it. I can get it to open up, but have no idea how to automatically
have the macro close it down when all is finished. Thanks again!!!
 
You should use this line to get past the pop up:

Application.Sendkeys "~"

To close the ie window when done use this:

ie.Quit
 
The application.sendkeys "~" didn't work for me, perhaps I'm using it in the
wrong place. Where would you place it?

It didn't error out, just ran through it and nothing happened.
 
You may want to add a wait statement before the sendkeys:

Application.Wait Now() + TimeValue("00:00:01")
Application.SendKeys "~", True

Adjust the timevalue until the enter key hits the popup.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top