[FONT=courier new]Option Explicit
Public Function ShowFolderList()[/FONT]
[FONT=courier new]Dim wb As Workbook
Dim i As Shape
Dim fld As String
Dim fs, f, f1, fc
Dim objcount As Integer
Dim wb1 As Workbook[/FONT]
[FONT=courier new]
Set wb1 = Workbooks.Add
wb1.Sheets(1).Range("A1").Value = "Workbook Names"
wb1.Sheets(1).Range("B1").Value = "msoLinkedOLEObject Count"
Cells.EntireColumn.AutoFit[/FONT]
[FONT=courier new]objcount = 0[/FONT]
[FONT=courier new]fld = FolderSelect()
If Len(fld) < 3 Then Exit Function
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder(fld)
Set fc = f.Files[/FONT]
[FONT=courier new] For Each f1 In fc
If f1 Like "*.*xls*" Then
Set wb = Workbooks.Open(Filename:=fld & "\" & f1.Name)
wb.Activate
For Each i In ActiveSheet.Shapes
If i.Type = msoLinkedOLEObject Then
objcount = objcount + 1
End If
Next
If objcount > 0 Then
wb1.Sheets(1).Range("A" & Rows.Count).End(xlUp).Offset(1, 0).Value = wb.Name
wb1.Sheets(1).Range("A" & Rows.Count).End(xlUp).Offset(0, 1).Value = objcount
End If
wb.Close
Set wb = Nothing
End If
Next
wb1.activate
msgbox "Completed!"
End Function
Public Function FolderSelect() As String
Dim fd As FileDialog
Set fd = Application.FileDialog(msoFileDialogFolderPicker)
Dim vrtSelectedItem As Variant
With fd
.AllowMultiSelect = False
If .Show = -1 Then
FolderSelect = .SelectedItems(1)
Else
End If
End With
Set fd = Nothing
End Function[/FONT]