Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, 2016, 2019, and Excel in Office 365. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Getting Rid of Workbook Links.

Getting Rid of Workbook Links

by Allen Wyatt
(last updated February 13, 2020)

3

Paula has a workbook that is linked to other workbooks. These are workbook links, not hyperlinks. She is looking for a way to break all of these types of links.

There are several ways you can approach such a task. One is to manually break the links by displaying the Data tab of the ribbon and clicking Edit Links in the Queries & Connections group. (If the Edit Links tool is not available, it means there are no links in the current workbook.) You can then select the links and click Break Link. You can even select all the links at once by creating a selection set (using Shift and Ctrl to compose the set) prior to clicking on Break Link.

If you prefer not to use the manual method, you can use a short macro to get rid of the links. The following is one example that will do the task:

Sub BreakLinks()
    Dim strLink
    For Each strLink In ActiveWorkbook.LinkSources
        ActiveWorkbook.BreakLink Name:=CStr(strLink), _
          Type:=xlExcelLinks
    Next strLink
End Sub

A third way to manage your links is to look to a third-party solution, such as FindLink or Name Manager. You can find them at the following pages:

http://www.manville.org.uk/software/findlink.htm
http://www.jkp-ads.com/OfficeMarketPlaceNM-EN.asp

FindLink was written by Bill Manville and Name Manager by Jan Karel Pieterse, both Excel MVPs.

Note:

If you would like to know how to use the macros described on this page (or on any other page on the ExcelTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (9903) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and Excel in Office 365. You can find a version of this tip for the older menu interface of Excel here: Getting Rid of Workbook Links.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Spell Checking Only Checking Grammar

Word has a built-in spelling and grammar checker that can help reduce errors in your prose. It may be a bit confusing if ...

Discover More

Parsing Non-Standard Date Formats

When you load data into Excel that was created in other programs, the formatting used for some types of data (such as ...

Discover More

Microsoft Word's Amazing Autos (Table of Contents)

Word provides several tools that can aid in developing your documents. This e-book focuses on a few of those tools. You ...

Discover More

Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!

More ExcelTips (ribbon)

Changing Huge Numbers of Hyperlinks

Need to change the various targets of a group of hyperlinks? Getting at the underlying link can seem challenging, but it ...

Discover More

Removing Hyperlinks without a Macro

If you have a whole slew of hyperlinks in a worksheet and you want to get rid of them, it's easier than you think. This ...

Discover More

Inserting Hyperlinks

Connect your worksheets with other workbooks or with the world of the Internet. The ability to add hyperlinks makes this ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is two minus 0?

2020-01-14 07:59:14

RKeev

Then why not combine name range removal and Links removal?
Sub BreakLinks()
Dim strLink
Dim kName As Name
For Each kName In Names
ActiveWorkbook.Names(kName.Name).Delete
Next

For Each strLink In ActiveWorkbook.LinkSources
ActiveWorkbook.BreakLink Name:=CStr(strLink), _
Type:=xlExcelLinks
Next strLink
End Sub


2020-01-14 06:56:16

Kevin

Hans Re the conditional formatting.
I know this solves it on my requirement which was to achieve one not linked sheet of just the visible formats and values (A yearly record into a combined years workbook).
Copy all used area of sheet.
Take it to a new workbook.
Paste Values, Paste Column Widths, Paste Formats (The three separate actions, If you need formulas or other actions you'll need to try them).
Confirm the new workbook doesn't have any links.
Copy the new created sheet back to where you want it.
I'm now onto guessing if you are wanting to delete the links from a workbook - Either now or a step or two earlier delete your problem sheet/s (I hope not too many sheets).
I hope it's capable of working for you.


2020-01-14 05:05:02

Hans

"Break Links" works fine for formulas and even for graphs, but it does not work for named ranges.
(see Figure 1 below)
There might also be links to other sheets in conditional formatting.
(see Figure 2 below)


Note : this conditional formatting is the result of copy/paste of a cell from one book to an other book. IN the original book, the conditonal formatting was referring to a cell on a second sheet. The result of the copy/paste is a non-working conditional formatting, but it nevertheless blocks the full breaking of linked sheets

Is there also an option to break these type of links? (other than manually one by one)

Figure 1. named range linked to other book

Figure 2. conditonal formatting linked to other book


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.