Removing Ghost links


Can't delete old links to images in a DWG that are deleted and no longer there.

Solution (a)

1. Go to "Tools" tab and select "Links" 

2. Select the image and "Break Link"


Solution (b)

If Solution (a) did not work, try saving the .dwg as .idw format, this should remove any connections as this does not transfer the connections. Then save the file back to .dwg.

Solution (c)

1. Go to Tools and open up "VBA Editor"


2. Select "ThisDocument" 



3. Copy the following VBA code into the window that pops up. Hence click "Run" to execute the code.


VBA Code

Public Sub DeleteOLEReference()
Dim oDoc As Document
Set oDoc = ThisApplication.ActiveDocument
If oDoc.ReferencedOLEFileDescriptors.Count = 0 Then
MsgBox "There aren't any OLE references in this document."
Exit Sub
End If
Dim aOLERefs() As ReferencedOLEFileDescriptor
ReDim aOLERefs(oDoc.ReferencedOLEFileDescriptors.Count - 1)
Dim iRefCount As Integer
iRefCount = oDoc.ReferencedOLEFileDescriptors.Count
Dim i As Integer
For i = 1 To iRefCount
Set aOLERefs(i - 1) = oDoc.ReferencedOLEFileDescriptors.Item(i)
For i = 1 To iRefCount
'If MsgBox("Delete """ & aOLERefs(i - 1).FullFileName & """?", vbQuestion + vbYesNo) = vbYes Then
aOLERefs(i - 1).Delete
'End If
End Sub


***This should delete any ghost links that exist.***











Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request


Please sign in to leave a comment.