Deletion of linked spreadsheet
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
I have a customer assembly that has a couple of linked spreadsheets which are no longer required.
I cannot share the assembly before anyone asks, but here is where the linked files appear in the parameter dialogue:
NOTE: Path obscured by me
Having tried this:
'Delete unwanted OLE references Sub Main() DeleteOLEReference() End Sub Public Sub DeleteOLEReference() Dim oDoc As Document 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 aOLERefs(i - 1) = oDoc.ReferencedOLEFileDescriptors.Item(i) Next For i = 1 To iRefCount If MsgBox("Delete """ & aOLERefs(i - 1).FullFileName & """?", vbQuestion + vbYesNo) = vbYes Then aOLERefs(i - 1).Delete End If Next End Sub
I am still stuck with the unecessary linked files.
The "Links" command on the tools tab does nothing, so is there some other API method I can tap into that will allow me to remove these linked files?
I even tried readding those exact same excel files at the original path but that results in a "duplicate to an existing link" message.
The last resort I suppose would be to create a new blank assembly, export the parameters from this assembly into it using the Export/Import Parameter tools and then copy/paste the contents of the current assembly into it.
Thoughts?
Alex Fielder
Inventor Expert
https://github.com/alexfielder/
LinkedIn - Github Inventor Extension Server - Bonkers polygon iLogic thing
Top ten iLogic Tips - API Shortcut In Google Chrome - Assembly Extrusion Example