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

Dividing Values

When working with large numbers, you may need a way to quickly divide a range of those numbers by a specific value. ...

Discover More

Hiding and Unhiding Rows

When building a worksheet, you may need to hide some of the rows or unhide other, previously hidden, rows. It's easy to ...

Discover More

Converting Individual Endnotes and Footnotes

Word makes it easy to convert all your footnotes to endnotes and vice versa. You may want to only convert a couple of ...

Discover More

Program Successfully in Excel! John Walkenbach's name is synonymous with excellence in deciphering complex technical topics. With this comprehensive guide, "Mr. Spreadsheet" shows how to maximize your Excel experience using professional spreadsheet application development tips from his own personal bookshelf. Check out Excel 2013 Power Programming with VBA today!

More ExcelTips (ribbon)

Editing a Hyperlink

Excel will cheerfully keep track of all sorts of hyperlinks for you. If you want to change the hyperlink in some way, ...

Discover More

Tying a Hyperlink to a Specific Cell

Make a hyperlink to a cell in your workbook, edit the structure of that workbook a bit, and you may find that the ...

Discover More

Generating Automatic Links to Audio Files

Need to create links to many filenames on your system? Here are a couple of quick ways to get just the connection you need.

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 1 + 7?

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.