Links


Posted by Rayn on May 13, 2001 4:18 PM

Hi

every time i open up excel it tells me that my workbook is
linked to another workbook, and asks me if i want to update the links.
i want to eliminate this link (delete it), but i can not find a way
as i do not have any fomulas (the workbook that i open is new).

Thank you for your help.



Posted by Dave Hawley on May 13, 2001 4:27 PM


Hi Rayn, here some more info on Phantom links:

1. Go to Insert>Name>Define and make sure you do not have any named ranges refering to an outside Workbook.

2. Go to Edit>Links and try to use the "Change Source" button to refer your link back to the your open workbook. In other words try and change the link so it refers to itself.

3. Open the a new workbook and create a link to it and Save. Now go to Edit>Links and use the "Change Source" to refer the link to the new Workbook. Save again and then delete the link you created.

.....If all the above fail, microsoft have seen this as a problem and have a free download here:

http://support.microsoft.com/support/kb/articles/Q188/4/49.ASP?LN=EN-US&SD=gn&FR=0&qry=delete%20links&rnk=1&src=DHCS_MSPSS_gn_SRCH&SPR=XLW97

In fact it is a handy add-in to have even if one of the above steps does work.


....and here is a macro I have written that will create a list of ALL external links in Formulas.


Sub ListExternalLinks()

'Written by OzGrid Business Applications
'www.ozgrid.com

'''''''''''''''''''''''''''''''''''''''''''''''''''''
'Creates a Worsheet called "Link List" and lists ALL _
external links in the Workbook.
'''''''''''''''''''''''''''''''''''''''''''''''''''''

Dim sht As Worksheet
Dim LinkCells As Range, Cell As Range
'Add a new sheet to list all external links.
On Error Resume Next
Sheets.Add().Name = "Link List"
Application.DisplayAlerts = False
'If name does NOT = "Link List" then it already exists
If ActiveSheet.Name <> "Link List" Then ActiveSheet.Delete
Application.DisplayAlerts = True
'Clear column A and format as text.
Sheets("Link List").Columns(1).Clear
Sheets("Link List").Columns(1).NumberFormat = "@"
'Loop through each worksheet
For Each sht In ThisWorkbook.Worksheets
'Set "LinkCells" to range that has formulas
Set LinkCells = Nothing
Set LinkCells = sht.Cells.SpecialCells(xlCellTypeFormulas)
If Not LinkCells Is Nothing Then
'Loop through each cell in "LinkCells"
For Each Cell In LinkCells
'See if if an external link or not.
If Cell.Formula Like "[*" Then
'It is, so copy the formula to column A of "Link List"
Sheets("Link List").Cells _
(65536, 1).End(xlUp).Offset(1, 0) = Cell.Formula
End If
Next Cell
End If 'Not LinkCells Is Nothing
Next sht
End Sub


Dave

OzGrid Business Applications