Macro to List Linked Excel Files
Use the below macro when you want to get a list of source files linked to an Excel file that you're using. It was posted to the Extend Office site, by the developers of Kutools. When you try to open an Excel file that has links in formulas to other Excel files which are no longer in the same location as when the file was created, you'll get a message like this:
This is a common problem in electronic discovery. Excel files will be produced in native format and then end up being used by someone working on a different network that does not have other Excel native files in the same location. If you can't find these files in the production database, you may need to make a list of them so you can request them from the other side. The macro features in tonight's post will create a new worksheet in your Excel file listing all of the source spreadsheets and their file paths.
Sub ListLinks() 'Updateby20140529 Dim wb As Workbook Set wb = Application.ActiveWorkbook If Not IsEmpty(wb.LinkSources(xlExcelLinks)) Then wb.Sheets.Add xIndex = 1 For Each link In wb.LinkSources(xlExcelLinks) Application.ActiveSheet.Cells(xIndex, 1).Value = link xIndex = xIndex + 1 Next link End If End Sub
[try copying the VB code of the Extend Office site, if copying & pasting in this code doesn't work.]