Bypassing Website Security Certificate in Excel Refresh

fluffynicesheep

Board Regular
Joined
Oct 27, 2009
Messages
69
Hi,

I currently have a code that runs when I open a workbook that simply refreshes all external data links, sorts information into order, saves and closes.

A couple of different websites that I'm linked to have issues with certificates, and a popup appears halfway through the refresh all, that says "Microsoft Excel Security Warning - The name on the Security Certificate is invalid or does not match the name of the site". It then asks if you want to proceed and gives the options of [Yes], [No] and [View Certificate].

I would like the VBA to automatically answer [YES] to this question, whenever it's asked and to continue running - so it reaches the end and closes without me having to press [enter]/

If someone could let me know what I need to add to this code, to either bypass the popup completely each time it displays, or to automatically select [yes] and click [enter] when asked that would be great.

Thanks

VBA Code:
Private Sub Workbook_Activate()
ActiveWorkbook.RefreshAll
DoEvents
Application.DisplayAlerts = False

      Dim ws As Worksheet, t As ListObject
    On Error Resume Next
    For Each ws In Sheets
        For Each t In ws.ListObjects
            t.Range.Sort key1:=t.Name & "[DATE]", Order1:=xlDescending
        Next
    Next
    
    ThisWorkbook.Save
Application.DisplayAlerts = True
Application.Quit
End Sub
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
FWIW, answering "Yes" to that question has consequences outside Excel. It means you are choosing to trust a site with an invalid or out of date security certificate. As a user I would never want that choice taken away from me on my own PC, no matter what the workbook author thinks.
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,160
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top