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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With