Computer >> Computer tutorials >  >> Software >> Office

How to Remove Unknown Links in Excel (4 Suitable Examples)

Sometimes we use the information of one Excel file for other. This way, we link Excel files one to another. Sometimes we see that, there are unknown links are present in the Excel file. In this article, we will discuss how to remove those unknown links in Excel and also the other external link with the proper illustration.

4 Examples to Remove Unknown Links in Excel

In the sample dataset, we can see that there are two external links Cell D5 and D9. In this article, we will show how to indicate those external links and then remove them.

How to Remove Unknown Links in Excel (4 Suitable Examples)

1. Remove Unknown Links from Cells

Links may exist in Excel in different forms. Here, we will show how to remove unknown links from cells. We will use the Data feature of Excel to remove links.

📌 Steps:

  • Click on the Data tab first.
  • Choose Edit Links from the Queries & Conditions group.

How to Remove Unknown Links in Excel (4 Suitable Examples)

  • The Edit Links window appears. We see the source link is showing here.
  • Click on the Break Link options.

How to Remove Unknown Links in Excel (4 Suitable Examples)

  • A warning dialog will show here. Choose the Break Links option.

How to Remove Unknown Links in Excel (4 Suitable Examples)

  • Again, look at the Edit Links window. Then, click on the Close option.

How to Remove Unknown Links in Excel (4 Suitable Examples)

The attached link has been removed successfully.

  • Now, move the cursor to Cell D5.

How to Remove Unknown Links in Excel (4 Suitable Examples)

We can see no links are showing here.

Read More: How to Remove Hyperlink from Excel (7 Methods)

2. Remove Unknown Links from Shapes

In this section, we have an oval shape. Also, the shape consists of an external link. We will remove this link here.

At first, we will check how many unknown links are present in the sheet.

How to Remove Unknown Links in Excel (4 Suitable Examples)

📌 Steps:

  • Press the F5 button and the Go To window will appear.
  • Click on the Special button.

How to Remove Unknown Links in Excel (4 Suitable Examples)

  • The Go To Special window appears.
  • Choose the Objects option.
  • Then, press the OK button.

How to Remove Unknown Links in Excel (4 Suitable Examples)

  • Now, all the external links will be selected. We can see only one unknown link present in the sheet.
  • Press the right button of the mouse.
  • Choose the Remove Link option from the Context Menu.

How to Remove Unknown Links in Excel (4 Suitable Examples)

The unknown link has been removed from the shape.

Read More: How to Remove External Links in Excel

3. Remove Unknown Links from Named Range

In this section, we will remove unknown links from Named Range.

We can see that in the dataset, the values of the Salary column are taken from a named range.

How to Remove Unknown Links in Excel (4 Suitable Examples)

📌 Steps:

  • Now, we will check the named range. Click on the Formulas tab.
  • Choose the Name Manager option.

How to Remove Unknown Links in Excel (4 Suitable Examples)

  • The Name Manager window appears.

How to Remove Unknown Links in Excel (4 Suitable Examples)

We can see there is an external source here. If we remove this external source from the named range the cells will be blank or values will remove also.

Read More: How to Remove Hyperlink for Entire Column in Excel (5 Ways)

4. Remove Unknown Links Using VBA

In this section, we will apply the VBA macro to remove unknown links. It also shows the number of unknown links that are removed from the file.

📌 Steps:

  • First, go to the bottom of the Excel Sheet.
  • Press the right button of the mouse.
  • Choose the View Code option from the Context Menu.

How to Remove Unknown Links in Excel (4 Suitable Examples)

  • We enter the VBA window.
  • Choose Module from the Insert tab.

How to Remove Unknown Links in Excel (4 Suitable Examples)

  • This is the VBA module. We will write VBA code here.

How to Remove Unknown Links in Excel (4 Suitable Examples)

  • Copy and paste the following VBA code on the module.
Sub Remove_Unknown_Links()
Dim Unknown_Links As Variant
Dim N, Remove_Link As Long
Unknown_Links = ActiveWorkbook.LinkSources(Type:=xlLinkTypeExcelLinks)
If IsEmpty(Unknown_Links) = True Then GoTo ReportResults
For N = 1 To UBound(Unknown_Links)
ActiveWorkbook.BreakLink Name:=Unknown_Links(N), Type:=xlLinkTypeExcelLinks
Remove_Link = Remove_Link + 1
Next N
ReportResults:
MsgBox "Unknown Links Removed: " & Remove_Link
End Sub

How to Remove Unknown Links in Excel (4 Suitable Examples)

  • Press F5 to run the code.

How to Remove Unknown Links in Excel (4 Suitable Examples)

A dialog box will appear. It presents the number of unknown links in the file.

  • Go to the sheet.

How to Remove Unknown Links in Excel (4 Suitable Examples)

We can see unknown links have been removed.

Code Explanation:

Dim Unknown_Links As Variant
Dim N, Remove_Link As Long

Declare the variables.

Unknown_Links = ActiveWorkbook.LinkSources(Type:=xlLinkTypeExcelLinks)

Set the active workbook as the value of one variable and check whether it consists of any links or not.

If IsEmpty(Unknown_Links) = True Then GoTo ReportResults

If there is no link, then go to the ReportResults section.

For N = 1 To UBound(Unknown_Links)

Check the links to the variable.

ActiveWorkbook.BreakLink Name:=Unknown_Links(N), Type:=xlLinkTypeExcelLinks

Converts the links into values.

Remove_Link = Remove_Link + 1

Remove the link.

Next N

Go to the next link.

MsgBox "Unknown Links Removed: " & Remove_Link

Print a text and the number of links.

Read More: How to Remove Hyperlink Permanently in Excel (4 Ways)

Conclusion

In this article, we described how to remove unknown links from the Excel file. We used a VBA code that indicates the number of links in the file also. I hope this will satisfy your needs. Please have a look at our website Exceldemy.com and give your suggestions in the comment box.

Related Articles

  • How to Remove Email Link in Excel (7 Quick Ways)
  • Remove All Hyperlinks in Excel (5 Methods)
  • How to Delete Hidden Link in Excel (5 Easy Ways)
  • [Solved]: Remove Hyperlink Not Showing in Excel (2 Solutions)
  • How to Remove Excel Links from Word Document