Circumvent Hyperlink Security Warning

I have a VBA script that loops through a list of ppt links to sharepoint, opens them, saves them in a temporary location, extracts information from specific text fields and closes them. However, when I try to open links, I get a security warning -

"Opening http: //.....pptm

Some files may contain viruses or otherwise be harmful to your computer. It is very important to be sure that this file is from a reliable source.

Do you want to open this file? "

I know that I can disable this by going to the registries; however, my company does not allow me to do this. Can anyone recommend a way

  • Automatically close these warnings / completely disable them.
  • Extract information from .ppts in another way.
+4
source share
2 answers

I have not tried them, but here are a few options:

.

  • ShellExecute (API):

.

Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _ (ByVal hwnd As Long, ByVal lpszOp As String, _ ByVal lpszFile As String, ByVal lpszParams As String, _ ByVal LpszDir As String, ByVal FsShowCmd As Long) _ As Long 

More from Microsoft

.

  1. Registry Editing:

    • Click "Start" and select "Run."
    • In the Open dialog box, type regedit and click OK.
    • In the registry editor, find and select one of the following registry keys: HKEY_CURRENT_USER \ Software \ Microsoft \ Office \ 11.0 \ Common HKEY_CURRENT_USER \ Software \ Policies \ Microsoft \ Office \ 11.0 \ Common

Notes:

  • You only need to change one of these registry keys, not both of them.
  • If the registry key HKEY_CURRENT_USER \ Software \ Policies \ Microsoft \ Office \ 11.0 \ Common does not exist, you may need to manually create it.

    1. After you click on the registry subkey, on the Edit menu, select New, and then click Key.
    2. Type Security and press Enter to name the key.
    3. From the Edit menu, select New, and then DWORD Value.
    4. Type DisableHyperlinkWarning and press Enter to specify the entry.
    5. In the right pane, right-click DisableHyperlinkWarning and choose Modify.
    6. In the Change DWORD Value dialog box, click Decimal, and then enter 1 in Value Data.

Note

  • A value of 0 enables the hyperlink warning message, and a value of 1 disables the warning message.

    1. Click OK.
    2. Close the registry editor.

More from Microsoft1 and Microsoft2

.

  1. VBA code to modify the registry:
 Option Explicit Function killHyperlinkWarning() Dim oShell As Object Dim strReg As String strReg = "Software\Microsoft\Office\11.0\Common\Security\Dis ableHyperlinkWarning" Set oShell = CreateObject("Wscript.Shell") oShell.RegWrite "HKCU\" & strReg, 1, "REG_DWORD" End Function 

found here

+1
source

Looking at the MS support page for this problem, it seems that all solutions for it are inevitably registry-based.

Tested and works for all versions of Office (using the registry):

Disable hyperlink warning:

 CreateObject("Wscript.Shell").RegWrite _ "HKCU\Software\Microsoft\Office\" & Application.Version & _ "\Common\Security\DisableHyperlinkWarning", 1, "REG_DWORD" 

(Re-) Enable hyperlink warning:

 CreateObject("Wscript.Shell").RegWrite _ "HKCU\Software\Microsoft\Office\" & Application.Version & _ "\Common\Security\DisableHyperlinkWarning", 0, "REG_DWORD" 
+1
source

All Articles