1

I wrote a VBA code which would take its input(url) from a column of an excel sheet, and return its http status code. The problem I face is that some urls are having Certificate issues and for some websites I am getting Windows Security Alerts. I want a simple solution to automatically click on Yes for all these alerts (if they come at all) as these sites are comletely trusted. I am attaching the the code which checks for the status code.

    `'Takes input url as String and return the status(200 is up ,rest all are down)

     Function urlCheck(url As String) As Integer
     On Error GoTo error_help
     Dim http: Set http = CreateObject("MSXML2.XMLHTTP")
     http.Open "GET", url, False
     http.Send
     If (Not http.Status = 200) Then
     urlCheck = http.Status
     Else
     urlCheck = http.Status
     End If
     error_help:
     'MsgBox "error"
     End Function

`

I have already tried Application.DisplayAlerts = False , it doesn't work

  • its been my experience that you can't auto dismiss a message box, only prevent them from popping at all (in some cases) does it generate an error number? does the on error catch it? if so you could try `on error resume next.` I'm not sure if that will work though. Those errors come up in the browser dont they? like when navigating to them, I don't know if it'd be possible to handle those messages in the excel app as thats not really where they are coming from, its the browser detecting the security stuff isnt it? – user1759942 Feb 24 '14 at 19:10
  • @user1759942 I have tried resume next but that doesn't solve the problem. If I try to navigate via the browser these errors - that is the certificate issue does come up to which one has to click on continue. But for some urls no browser error comes up, its just when I use this macro that I face the below error _Windows Security Warning – This page is accessing information that is not under its control. This poses a security risk. Do you want to continue?_ I think that those urls redirects to another pages which do not give error from browser. Nevertheless I do not want these alerts ! – user3347935 Feb 25 '14 at 21:03
  • so the urls that are generating the errors, if you navigate to them in the broswer does it or does it not give an error? Again, I think these are errors that are outside of Excel, and can't be handled in excel. I think they need to be handled in windows, by changing security settings either in the browser or somewhere else. – user1759942 Feb 25 '14 at 21:20

0 Answers0