How to stop users adding links to other workbooks

New Contributor


We use Excel for preparing budget files. These files then get collated in MS Power BI for group wide analysis.

One issue we have is that users can sometimes paste links from spreadsheets on their desktops into the budget files. This naturally causes problems when other users open them.

Is there any way to prevent external links from being inserted? I've searched in Data Validation and Protect Sheet but haven't found anything suitable.

8 Replies
Stop Automatic Hyperlinks in Excel

How to stop automatic hyperlinks in Excel?

To turn the hyperlink option off in Excel

On the Tools menu, choose AutoCorrect Options
Select the AutoFormat as you type tab
Remove the check mark from Internet and network paths with hyperlinks
Click OK

Remove a Hyperlink Manually

If you want to leave the hyperlink feature on, you can undo the hyperlink immediately after it's created.

To manually remove the hyperlink:

Type the email address and press Enter
Immediately, press Ctrl+Z.

This is a shortcut for Undo, and will convert the hyperlink back to text.
Remove Selected Hyperlinks Programmatically

To change a group of cells that contain hyperlinks, you can use the following code. It deletes all the hyperlinks in the selected cells.

Sub delHyperlinks()
Dim myCell As Range
For Each myCell In Selection
Next myCell
End Sub

I would be happy to find out if I could help.

I know I don't know anything (Socrates)

@NikolinoDE , the issue isn't hyperlinks as such, its cells pointing at external workbooks. So cells with values like the below


='[Desktop Budget File]Project Budget'!$I$23


=C://users/userA/desktop/'[Desktop Budget File]Project Budget'!$I$23

im not sure but if you make a modul,
insert this code.

Option Explicit
Sub DeleteHyperlinks()
End Sub

Please see this link too, maybe helps:

I am having this same issue.  We use a standard template that users download and complete.  The file has embedded logic, data validations and defined pivots.  Many users are are saving / copying the data into the template that results in data corruptions, link issues and content enablement warning.  The handling of the file seems to pickup every storage location along the way.  This is degrading the effectiveness of this tool.  


This issue is not Hyper Links but the embedded references to name ranges that get corrupted.  


How can this be prevented?




Got another way to stop hyperlinks, found on the internet.

Break all external links with VBA code

If you want to break all of the external links, both the ok and error links, the following VBA code can help you to break them all.

1. Hold down the ALT + F11 keys, and it opens the Microsoft Visual Basic for Applications window.

2. Click Insert > Module, and paste the following code in the Module Window.


Sub BreakLinks()
Dim wb As Workbook
Set wb = Application.ActiveWorkbook
If Not IsEmpty(wb.LinkSources(xlExcelLinks)) Then
    For Each link In wb.LinkSources(xlExcelLinks)
        wb.BreakLink link, xlLinkTypeExcelLinks
    Next link
End If
End Sub


Then press F5 key to run the code, and all of the external links in the whole workbook have been broken.


Hope I was able to help you with this info.



I know I don't know anything (Socrates)


I've run into same issue.
The problem is not breaking external links. I just wanna prevent my users from using external links.
Users from overseas use Excel budget files (stored in sharepoint) for providing the headoffice with budget monthly figures. I consolidate data coming from these excel files with PowerQuery (Excel or PowerBI).
I just wanna prevent users from using external links to other excel files stored in their pc. I want them to have to type figures. When I receive those files they already contain many "#REF!", so breaking links doesn't help ( they should break external links before sharing the files , but they forget to do that).
When users enter figures by using external links to their excel files I receive many "#REF!" cell which generate an error when I import this files with PowerQuery in another consolidation file or in PowerBI.
How to prevent them from using external links ?


Block or unblock external content in Office documents

To help protect your security and privacy, Microsoft Office is configured by default to block external content—such as images, linked media, hyperlinks, and data connections—in workbooks and presentations. Blocking external content helps to prevent Web beacons and other intrusive methods that hackers use to invade your privacy and lure you into running malicious code without your knowledge or consent.


Thank you for your understanding and patience



I know I don't know anything (Socrates)


Question: The problem is not breaking external links. I just wanna prevent my users from using external links.


You could also do it with the Protection Worksheet.
First you have to select the cells with the hyperlinks,
then right mouse button, format cells, click on Protection above, clicked the Locked box, OK.

After that:
By going to Review, protect sheet. New window opens. Protect worksheet and contents of locked cells check the box.
Select locked cells, check box Empty.

So nobody can press on the hyperlink, see yes, press on it no. At least that's how it is in Excel 2016.


Additional Info:

Description of link management



Thank you for you all understanding and patience




I know I don't know anything (Socrates)