15

If you open an Excel spreadsheet containing external hyperlinks, when you click the link, Excel will check that the link is valid (i.e. doesn't return a 404 error) before actually opening it in the browser.

This is utterly maddening for me and I cannot for the life of me figure out why the developers could have ever fathomed that this would be a remotely good idea.

The side-effect is that hyperlinks take a longer time to open, and/or cannot be opened at all if Excel's connection to your network is blocked (e.g. by a firewall).

I have tried disabling all the options in the "Trust Center" that relate to links but nothing has helped.

How can I turn off link checking in Excel forever?

3
  • Good question didn't know it did that. You could you google docs though.
    – Griffin
    Mar 8, 2013 at 1:08
  • What do you expect or want to happen "if Excel's connection to your network is blocked (e.g. by a firewall)"? Mar 8, 2013 at 1:18
  • 2
    It should act like any other application and simply launch the default program associated with the link's protocol (e.g. "http://" = web browser).
    – WackGet
    Mar 8, 2013 at 2:42

4 Answers 4

5

A registry setting can change this behavior and force Excel to simply launch URL's in the default browser. There could be security implications, so be sure to read the following article carefully and decide if it's the right thing for you to do.

http://support.microsoft.com/kb/218153#FixItForMeAlways

I ran the "Fix it for me" application after several unsuccessful attempts to manually make the registry edits.

Now my hyperlinks launch in the default browser, without the pre-check, regardless if it's clicked by the user, or programmatically launched in VBA.

5
  • 1
    You are my hero. Although the regardless if it's clicked by the user, or programmatically launched in VBA part is really stupid of Microsoft. Thanks.
    – WackGet
    May 2, 2013 at 3:34
  • It works! I just want to note that the registry key is HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\9.0\Common\Internet for Excel 2007, 2010 and 2013 (so do not change it to Office\15.0, etc.)
    – EM0
    Dec 1, 2015 at 23:36
  • 1
    With Office 2016 (or whatever the latest is as of posting this), I had to manually edit `...\Office\16.0` for it to work. May 12, 2020 at 14:11
  • Is there also a solution for office 2003?
    – peter
    May 25, 2021 at 15:40
  • Which "Fix it for me" application are you referring to?
    – Stenemo
    Aug 5, 2022 at 10:36
0

In excel 2003, the ForceShellExecute=1 regedit solution does not work. My workaround is calling the links directly from the shell using a macro. The below macro is right now creating 2 types of links from the current row depending on which column I click. This can of course be changed to check if there is a link in the cell you're selecting. Also selecting with right mouse button works in case there is an active link in the cell.

Option Explicit

Private Declare Function ShellExecute _
  Lib "shell32.dll" Alias "ShellExecuteA" ( _
  ByVal hWnd As Long, _
  ByVal Operation As String, _
  ByVal Filename As String, _
  Optional ByVal Parameters As String, _
  Optional ByVal Directory As String, _
  Optional ByVal WindowStyle As Long = vbMinimizedFocus _
  ) As Long

Public Sub OpenUrl(link As String)
    Dim lSuccess As Long
    lSuccess = ShellExecute(0, "Open", link)
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Dim c As Range: Set c = Selection
    If c.Count <> 1 Then Exit Sub
        
    Dim y As Integer: Let y = c.Row
    If y < 11 Then Exit Sub
    
    Dim name As String: Let name = Cells(y, 3).Value
    If name = "" Then Exit Sub
    
    Dim x As Integer: Let x = c.Column
    Dim link As String: Let link = ""
    If x = 10 Then Let link = "prefix of link type 1"
    If x = 11 Then Let link = "prefix of link type 2"
    If link = "" Then Exit Sub
    
    link = link & name
    OpenUrl link
End Sub
0

For more people struggling: I made a small solution for this, it has also a hosted variant.

-1

Excel finds out what the link points to / returns - another excel file, a word document, a web page etc and then opens that in the respective application or itself. This is desired functionality.

2
  • 3
    Right, except while you call it desired functionality, I call it needless interference. If my spreadsheet is full of http hyperlinks to other spreadsheets, they should open via the browser as normal and Excel should not attempt to "intercept" them. But this is especially true when it's an external URL and the extension is not an Office document.
    – WackGet
    Mar 8, 2013 at 2:44
  • There is no way to tell what mime type the content returned by a hyperlink will be without retrieving it. The extension is not sufficient.
    – Brian
    Mar 8, 2013 at 13:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.