+ Reply to Thread
Results 1 to 11 of 11

Detecting broken hyperlinks

  1. #1
    Registered User
    Join Date
    02-22-2012
    Location
    UK
    MS-Off Ver
    Excel 2010 and 2013
    Posts
    25

    Detecting broken hyperlinks

    I've searched on here - could not find anything that works for me.

    I have a worksheet which contains a listing of hyperlinked cells to local files.

    What is the best way of detect broken links to the file (i.e. missing file etc) and to output this to a cell next to the link, i.e. LIVE / DEAD

    Many thanks

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Detecting broken hyperlinks

    Did you find this one...
    Checking for broken hyperlinks
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    02-22-2012
    Location
    UK
    MS-Off Ver
    Excel 2010 and 2013
    Posts
    25

    Re: Detecting broken hyperlinks

    Yes that was the one I tried and did not do anything for me.

    When testing this, I have purposely put in invalid link to a file (which was named incorrectly) but the link you provided did not change the text to yellow or anything.

    Was there anything else I am supposed to do?

    Thanks

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Detecting broken hyperlinks

    It works for me.
    Did you select the hyperlinks before running the macro? It tests just your selection.
    In your invalid link, did you make its' hyperlink address incorrect and not just the displayed text?

  5. #5
    Registered User
    Join Date
    02-22-2012
    Location
    UK
    MS-Off Ver
    Excel 2010 and 2013
    Posts
    25

    Re: Detecting broken hyperlinks

    Hmm wonder why did it not work for me.

    Yes I did select the cell containing the following:

    =HYPERLINK("\docs\rename.txt","THE FILE")

    The actual document is in "rename.txt" without the 'docs' folder.

  6. #6
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Detecting broken hyperlinks

    Quote Originally Posted by GreenWheels View Post
    Hmm wonder why did it not work for me.

    Yes I did select the cell containing the following:

    =HYPERLINK("\docs\rename.txt","THE FILE")

    The actual document is in "rename.txt" without the 'docs' folder.
    That code doesn't work for hyperlink formulas. It only works for hyperlink objects that where created by Insert\Hyperlink. Can you use the hyperlink object instead of the HYPERLINK formulas?

  7. #7
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Detecting broken hyperlinks

    This should test HYPERLINK formulas.

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    02-22-2012
    Location
    UK
    MS-Off Ver
    Excel 2010 and 2013
    Posts
    25

    Re: Detecting broken hyperlinks

    Quote Originally Posted by AlphaFrog View Post
    That code doesn't work for hyperlink formulas. It only works for hyperlink objects that where created by Insert\Hyperlink. Can you use the hyperlink object instead of the HYPERLINK formulas?
    Ah - thats why it never worked.

    I create a long list of the formulas taking values from other cells so it has to be formulas rather than insert hyperlink object

  9. #9
    Registered User
    Join Date
    02-22-2012
    Location
    UK
    MS-Off Ver
    Excel 2010 and 2013
    Posts
    25

    Re: Detecting broken hyperlinks

    Quote Originally Posted by AlphaFrog View Post
    This should test HYPERLINK formulas.

    Please Login or Register  to view this content.
    This works for me - but it also highlight yellow for all cells that contained the hyperlink formulas regardless if it's a live/broken links

  10. #10
    Registered User
    Join Date
    02-22-2012
    Location
    UK
    MS-Off Ver
    Excel 2010 and 2013
    Posts
    25

    Re: Detecting broken hyperlinks

    Do the script check the connection to a file and highlight those that either have incorrect path/file names or the file that may be missing?

    It's just that this script only highlight any hyperlink in yellow.

  11. #11
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Detecting broken hyperlinks

    The macro finds within the HYPERLINK formulas the string address in quotes as in your example;
    =HYPERLINK("\docs\rename.txt","THE FILE")
    Then it tests if that address is valid.

    I suspect you're using cell references for the address instead of a literal string address. If that's the case, try this...
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Checking for broken hyperlinks
    By ChrisMattock in forum Excel Programming / VBA / Macros
    Replies: 26
    Last Post: 06-22-2018, 02:46 PM
  2. Broken hyperlinks to files
    By biederboat in forum Excel General
    Replies: 8
    Last Post: 12-10-2014, 06:46 PM
  3. Worksheets with broken or no hyperlinks
    By Geoffreym in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-12-2014, 06:20 AM
  4. Fixing broken HTML hyperlinks
    By kevmartin in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-10-2011, 02:03 AM
  5. Broken Hyperlinks (lots in one sheet)
    By NeedsExcelHelp in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-01-2011, 02:22 PM
  6. Excel 2007 : Hide Broken Hyperlinks
    By mrbougles in forum Excel General
    Replies: 0
    Last Post: 03-11-2011, 06:57 AM
  7. Broken hyperlinks
    By Nigel in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 06-16-2008, 05:34 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1