Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find location of link in Excel workbook?

Tags:

excel

vba

I have an Excel book that, when opened, gives the warning:

This workbook contains links to other data sources.

I want to remove all of these links so that the warning will not be triggered. Thinking that any external link will be of the form '[workbook path]'!address I used this code:

Sub ListLinks()
Dim wb As Workbook
Dim link As Variant
Set wb = ThisWorkbook
For Each link In wb.LinkSources(xlExcelLinks)
    Debug.Print link
Next link

End Sub

This returned a file path:

\\somePath\xyz\aWorkbook.xlsm

I searched all formulas in the workbook for this string using Ctrl+F, but no results were returned. How do I find and remove this link?

like image 262
sigil Avatar asked Nov 20 '25 06:11

sigil


1 Answers

Your workbook could be linking via a named range pointing to another workbook. A search of formulas for the linked workbook may find nothing because the link is hidden in the name.

Check your named ranges for links to other workbooks.

like image 163
Mark Fitzgerald Avatar answered Nov 23 '25 00:11

Mark Fitzgerald



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!