?
Solved

dealing with windows popups

Posted on 2013-11-17
5
Medium Priority
?
239 Views
Last Modified: 2013-11-18
folks

I have a macro code that queries web urls if they are up or not, however some of them have certificate mismatches and when the macro runs the end user using excel needs to confirm the windows security alerts, how can I build code into the macro to say yes and confirm all popups ?, would be glad for your thoughts


Sub GetStatus(ByVal Ref As String)
    Dim HttpReq As Object
    Dim Rslt As Variant
   
    Set HttpReq = CreateObject("MSXML2.XMLHTTP")
   
    On Error Resume Next
    With HttpReq
        .Open "GET", ActiveSheet.Range(Ref).Value, False
        .Send
        If Err Then
            Rslt = "No connection"
        Else
            Rslt = Val(.Status)
            If Err Then
                Rslt = "No Response"
            Else
                Rslt = "Status: " & Rslt
            End If
        End If
    End With
    ActiveSheet.Range(Ref).Offset(0, 1).Value = Rslt
    ActiveSheet.Range(Ref).Offset(0, 2).Value = Now()
End Sub
0
Comment
Question by:rutgermons
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 11

Expert Comment

by:Gregory Miller
ID: 39655378
I think a better solution is to simply install the invalid certificate into IE of the machine running this script. You do it once and never again, or at least until the certificate invalid state changes somehow.
<link removed - GaryC123 TA>

Be aware there are differences between IE7 and earlier versions versus IE8 and later versions on how to do this. Follow the steps to the letter and you will nail this issue down. No code required.
0
 
LVL 65

Accepted Solution

by:
RobSampson earned 2000 total points
ID: 39658163
Does it help if you use
Set HttpReq = CreateObject("MSXML2.ServerXMLHTTP.6.0")

and then add this above the GET line:
HttpReq.setOption 2, 13056

Regards,

Rob.
0
 

Author Comment

by:rutgermons
ID: 39658183
Cheers Rob, seems to work, is this a standard code to ignore bad certs?
0
 
LVL 65

Expert Comment

by:RobSampson
ID: 39658193
They are options for that COM object:
http://msdn.microsoft.com/en-us/library/ms763811(v=vs.85).aspx

Thanks for the grade.

Regards,

Rob.
0
 

Author Comment

by:rutgermons
ID: 39658206
thanks
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question