SlideShare a Scribd company logo
EXCEL HYPERLINKS 7 OCTOBER 2016
Richard Robinson Page | 1
Excel Hyperlinks
Purpose
This document is to describe the behaviour and preferred method of using Hyperlinks in an Excel Workbook. It applies
to Microsoft Office version 2003 through to 2016.
URL Explained
A URL contains a protocol, such as HTTP, FTP, or FILE, a Web server or network location, and a path and file name. (1).
The following illustration defines the parts of the URL:
The four components of a URL e.g. http://www.microsoft.com/office/products/default.htm
1. Protocol used (http, ftp, file) e.g. http://
2. Web server or network location e.g. www.microsoft.com/
3. Path e.g. office/products/
4. File name e.g. default.htm
Relative Reference
If a file is within the same folder then the relative reference to that file is the file name only. E.g. default.htm. If the file
is in the folder above, it will be referenced with two dots (../default.htm). The folder above the folder above will be
referenced by (../../default.htm).
Excel Behaviour
When Excel inserts a hyperlink it will use the full UNC (Universal Naming Convention) for the insert, however, when the
file is saved, it converts the UNC to a relative reference. The text which is displayed in the cell does not change. Hence
you might have
“T:FINANCENEW Fund FinanceKPMG Documents2014-2015QABFAudited Financial StatementsABCD.pdf”
displayed in the cell as the hyperlink, but the address behind the cell is “../../../../../KPMG%20Documents/2014-
2015/QABF/Audited%20Financial%20Statements/ABCD.pdf”.
(Note that spaces are replaced with %20)
The relative reference is fine if you are never going to move the file. It is also fine if you are about to zip a whole group
of files together and they have relative links to each other. They can be moved about no problem. However, if you
insert a hyperlink and then move a file, it is unlikely that the relative reference will continue to function.
Using the Hyperlink Function as a workaround (Preferred)
The syntax for the hyperlink function is:
=HYPERLINK(link_location, [friendly_name])
Note that the friendly name is optional. Using this format e.g. =Hyperlink(C:TempTest.xlsx) will ensure that the direct
address is retained. If there are spaces in any of the folder or file names then you will need to surround the address in
quotes. E.g. =Hyperlink(“C:TempFirst Test.xlsx”)
EXCEL HYPERLINKS 7 OCTOBER 2016
Richard Robinson Page | 2
Using the Hyperlink Base as a Workaround
To avoid this situation, a suitable work around is to place an arbitrary, not-likely-to-be-used drive reference in the
Hyperlink Base field. Access this field from File-Info, then click on the arrow next to Properties and select advance
properties (2010 – 2016). There you will find the Hyperlink Base field and you can insert something along the lines of
“O:”. The letter “O” is unlikely to be used as a real drive. If you use this method, then it needs to be done prior to
inserting any hyperlinks and must be done on each workbook. For reasons unclear, this forces Excel to use the full UNC
path.
Note:
Office 2007: Office button-Prepare-Properties-Document properties dropdown->Advanced properties-Summary
Tab
Office 2003: FilePropertiesSummary Tab
Visual Basic Macro (Advanced User)
If you have a significant amount of hyperlinks in a worksheet, the following visual basic can be used to convert all
hyperlinks in the active worksheet to the “Friendly Name”. This may not always be practical as sometimes the friendly
name has been set to something other than the UNC path for brevity reasons. If you are familiar with Visual Basic, you
may use this script however, if you are not sure what to do with it, then seek the assistance of someone who does.
Once the script has been successfully run, the module may then be deleted to retain a macro-free file.
Public Sub FixHyperlinks()
Dim wks As Worksheet
Dim hl As Hyperlink
Set wks = ActiveSheet
For Each hl In wks.Hyperlinks
hl.Address = hl.TextToDisplay
Next hl
End Sub
References
1. https://support.office.com/en-gb/article/Create-select-edit-or-delete-a-hyperlink-472fce40-c5f0-427e-90d4-
12c0366bc06f?CorrelationId=c1900ec3-19a6-4e11-af21-8387009e5eb8&ui=en-US&rs=en-
GB&ad=GB&ocmsassetID=HP010342381#__toc289683030
2. http://ludditegeek.blogspot.com.au/2013/10/excel-hyperlinks-relative-vs-
absolute.html?_sm_au_=iVVkN5qD226DVNVr
3. https://support.office.com/en-us/article/HYPERLINK-function-333C7CE6-C5AE-4164-9C47-
7DE9B76F577F?ui=en-US&rs=en-US&ad=US

More Related Content

Similar to ExcelHyperlinks

Introduction to linking
Introduction to linkingIntroduction to linking
Introduction to linkingShehzad Yaqoob
 
Intro to Talend Open Studio for Data Integration
Intro to Talend Open Studio for Data IntegrationIntro to Talend Open Studio for Data Integration
Intro to Talend Open Studio for Data Integration
Philip Yurchuk
 
Internet with HTML
Internet with HTMLInternet with HTML
Internet with HTML
umesh patil
 
Intro to OctoberCMS
Intro to OctoberCMSIntro to OctoberCMS
Intro to OctoberCMS
Kenton Spence
 
Apache
Apache Apache
Apache
Gouthaman V
 
FED presentation
FED presentationFED presentation
FED presentation
ClausDue
 
HTML Lists & Llinks
HTML Lists & LlinksHTML Lists & Llinks
HTML Lists & Llinks
Nisa Soomro
 
Must be similar to screenshotsI must be able to run the projects.docx
Must be similar to screenshotsI must be able to run the projects.docxMust be similar to screenshotsI must be able to run the projects.docx
Must be similar to screenshotsI must be able to run the projects.docx
herthaweston
 
Web Development From the Ground Up, a Series for Novice ...
Web Development From the Ground Up, a Series for Novice ...Web Development From the Ground Up, a Series for Novice ...
Web Development From the Ground Up, a Series for Novice ...webhostingguy
 
<img src="../i/r_14.png" />
<img src="../i/r_14.png" /><img src="../i/r_14.png" />
<img src="../i/r_14.png" />tutorialsruby
 
php-mysql-tutorial-part-3
php-mysql-tutorial-part-3php-mysql-tutorial-part-3
php-mysql-tutorial-part-3tutorialsruby
 
<b>PHP</b>/MySQL <b>Tutorial</b> webmonkey/programming/
<b>PHP</b>/MySQL <b>Tutorial</b> webmonkey/programming/<b>PHP</b>/MySQL <b>Tutorial</b> webmonkey/programming/
<b>PHP</b>/MySQL <b>Tutorial</b> webmonkey/programming/tutorialsruby
 
php-mysql-tutorial-part-3
php-mysql-tutorial-part-3php-mysql-tutorial-part-3
php-mysql-tutorial-part-3tutorialsruby
 
XML Tutor maXbox starter27
XML Tutor maXbox starter27XML Tutor maXbox starter27
XML Tutor maXbox starter27
Max Kleiner
 
Php advance
Php advancePhp advance
Php advance
Rattanjeet Singh
 
Basic Make
Basic MakeBasic Make
Basic Make
Alec Clews
 
WELCOME-FOLKS--CSS.-AND-HTMLS.pptx
WELCOME-FOLKS--CSS.-AND-HTMLS.pptxWELCOME-FOLKS--CSS.-AND-HTMLS.pptx
WELCOME-FOLKS--CSS.-AND-HTMLS.pptx
HeroVins
 
Drupal 8 meets to symphony
Drupal 8 meets to symphonyDrupal 8 meets to symphony
Drupal 8 meets to symphony
Brahampal Singh
 
HTML Foundations, part 1
HTML Foundations, part 1HTML Foundations, part 1
HTML Foundations, part 1
Shawn Calvert
 

Similar to ExcelHyperlinks (20)

Introduction to linking
Introduction to linkingIntroduction to linking
Introduction to linking
 
Intro to Talend Open Studio for Data Integration
Intro to Talend Open Studio for Data IntegrationIntro to Talend Open Studio for Data Integration
Intro to Talend Open Studio for Data Integration
 
Internet with HTML
Internet with HTMLInternet with HTML
Internet with HTML
 
Intro to OctoberCMS
Intro to OctoberCMSIntro to OctoberCMS
Intro to OctoberCMS
 
Apache
Apache Apache
Apache
 
FED presentation
FED presentationFED presentation
FED presentation
 
HTML Lists & Llinks
HTML Lists & LlinksHTML Lists & Llinks
HTML Lists & Llinks
 
Must be similar to screenshotsI must be able to run the projects.docx
Must be similar to screenshotsI must be able to run the projects.docxMust be similar to screenshotsI must be able to run the projects.docx
Must be similar to screenshotsI must be able to run the projects.docx
 
Web Development From the Ground Up, a Series for Novice ...
Web Development From the Ground Up, a Series for Novice ...Web Development From the Ground Up, a Series for Novice ...
Web Development From the Ground Up, a Series for Novice ...
 
<img src="../i/r_14.png" />
<img src="../i/r_14.png" /><img src="../i/r_14.png" />
<img src="../i/r_14.png" />
 
php-mysql-tutorial-part-3
php-mysql-tutorial-part-3php-mysql-tutorial-part-3
php-mysql-tutorial-part-3
 
<b>PHP</b>/MySQL <b>Tutorial</b> webmonkey/programming/
<b>PHP</b>/MySQL <b>Tutorial</b> webmonkey/programming/<b>PHP</b>/MySQL <b>Tutorial</b> webmonkey/programming/
<b>PHP</b>/MySQL <b>Tutorial</b> webmonkey/programming/
 
php-mysql-tutorial-part-3
php-mysql-tutorial-part-3php-mysql-tutorial-part-3
php-mysql-tutorial-part-3
 
XML Tutor maXbox starter27
XML Tutor maXbox starter27XML Tutor maXbox starter27
XML Tutor maXbox starter27
 
Php advance
Php advancePhp advance
Php advance
 
Book
BookBook
Book
 
Basic Make
Basic MakeBasic Make
Basic Make
 
WELCOME-FOLKS--CSS.-AND-HTMLS.pptx
WELCOME-FOLKS--CSS.-AND-HTMLS.pptxWELCOME-FOLKS--CSS.-AND-HTMLS.pptx
WELCOME-FOLKS--CSS.-AND-HTMLS.pptx
 
Drupal 8 meets to symphony
Drupal 8 meets to symphonyDrupal 8 meets to symphony
Drupal 8 meets to symphony
 
HTML Foundations, part 1
HTML Foundations, part 1HTML Foundations, part 1
HTML Foundations, part 1
 

ExcelHyperlinks

  • 1. EXCEL HYPERLINKS 7 OCTOBER 2016 Richard Robinson Page | 1 Excel Hyperlinks Purpose This document is to describe the behaviour and preferred method of using Hyperlinks in an Excel Workbook. It applies to Microsoft Office version 2003 through to 2016. URL Explained A URL contains a protocol, such as HTTP, FTP, or FILE, a Web server or network location, and a path and file name. (1). The following illustration defines the parts of the URL: The four components of a URL e.g. http://www.microsoft.com/office/products/default.htm 1. Protocol used (http, ftp, file) e.g. http:// 2. Web server or network location e.g. www.microsoft.com/ 3. Path e.g. office/products/ 4. File name e.g. default.htm Relative Reference If a file is within the same folder then the relative reference to that file is the file name only. E.g. default.htm. If the file is in the folder above, it will be referenced with two dots (../default.htm). The folder above the folder above will be referenced by (../../default.htm). Excel Behaviour When Excel inserts a hyperlink it will use the full UNC (Universal Naming Convention) for the insert, however, when the file is saved, it converts the UNC to a relative reference. The text which is displayed in the cell does not change. Hence you might have “T:FINANCENEW Fund FinanceKPMG Documents2014-2015QABFAudited Financial StatementsABCD.pdf” displayed in the cell as the hyperlink, but the address behind the cell is “../../../../../KPMG%20Documents/2014- 2015/QABF/Audited%20Financial%20Statements/ABCD.pdf”. (Note that spaces are replaced with %20) The relative reference is fine if you are never going to move the file. It is also fine if you are about to zip a whole group of files together and they have relative links to each other. They can be moved about no problem. However, if you insert a hyperlink and then move a file, it is unlikely that the relative reference will continue to function. Using the Hyperlink Function as a workaround (Preferred) The syntax for the hyperlink function is: =HYPERLINK(link_location, [friendly_name]) Note that the friendly name is optional. Using this format e.g. =Hyperlink(C:TempTest.xlsx) will ensure that the direct address is retained. If there are spaces in any of the folder or file names then you will need to surround the address in quotes. E.g. =Hyperlink(“C:TempFirst Test.xlsx”)
  • 2. EXCEL HYPERLINKS 7 OCTOBER 2016 Richard Robinson Page | 2 Using the Hyperlink Base as a Workaround To avoid this situation, a suitable work around is to place an arbitrary, not-likely-to-be-used drive reference in the Hyperlink Base field. Access this field from File-Info, then click on the arrow next to Properties and select advance properties (2010 – 2016). There you will find the Hyperlink Base field and you can insert something along the lines of “O:”. The letter “O” is unlikely to be used as a real drive. If you use this method, then it needs to be done prior to inserting any hyperlinks and must be done on each workbook. For reasons unclear, this forces Excel to use the full UNC path. Note: Office 2007: Office button-Prepare-Properties-Document properties dropdown->Advanced properties-Summary Tab Office 2003: FilePropertiesSummary Tab Visual Basic Macro (Advanced User) If you have a significant amount of hyperlinks in a worksheet, the following visual basic can be used to convert all hyperlinks in the active worksheet to the “Friendly Name”. This may not always be practical as sometimes the friendly name has been set to something other than the UNC path for brevity reasons. If you are familiar with Visual Basic, you may use this script however, if you are not sure what to do with it, then seek the assistance of someone who does. Once the script has been successfully run, the module may then be deleted to retain a macro-free file. Public Sub FixHyperlinks() Dim wks As Worksheet Dim hl As Hyperlink Set wks = ActiveSheet For Each hl In wks.Hyperlinks hl.Address = hl.TextToDisplay Next hl End Sub References 1. https://support.office.com/en-gb/article/Create-select-edit-or-delete-a-hyperlink-472fce40-c5f0-427e-90d4- 12c0366bc06f?CorrelationId=c1900ec3-19a6-4e11-af21-8387009e5eb8&ui=en-US&rs=en- GB&ad=GB&ocmsassetID=HP010342381#__toc289683030 2. http://ludditegeek.blogspot.com.au/2013/10/excel-hyperlinks-relative-vs- absolute.html?_sm_au_=iVVkN5qD226DVNVr 3. https://support.office.com/en-us/article/HYPERLINK-function-333C7CE6-C5AE-4164-9C47- 7DE9B76F577F?ui=en-US&rs=en-US&ad=US