You can try this. It's the Last Author that seems to take the long time
Option Explicit
Dim ws As Worksheet
Dim oApp As Application
Dim oFSO As Object
Sub test1()
Dim folderPath As String
' Prompt user to select folder
With Application.FileDialog(msoFileDialogFolderPicker)
.Title = "Select Folder"
If .Show <> -1 Then Exit Sub
folderPath = .SelectedItems(1)
End With
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oApp = New Application
oApp.Visible = False
oApp.DisplayAlerts = False
On Error Resume Next
Application.DisplayAlerts = False
Worksheets("File Details").Delete
Worksheets.Add.Name = "File Details"
Set ws = Worksheets("File Details")
ws.Range("A1:C1").Value = Array("Filename", "Date Modified", "Modified By")
Call ListFilesRecursive(oFSO.GetFolder(folderPath))
Application.ScreenUpdating = True
Application.DisplayAlerts = False
Application.StatusBar = False
ws.Select
ws.Rows(2).Select
ActiveWindow.FreezePanes = True
ws.Columns("A:C").EntireColumn.AutoFit
MsgBox "Done"
End Sub
Sub ListFilesRecursive(Flder As Object)
Dim oFile As Object, oSubfolder As Object
Dim sExt As String
For Each oFile In Flder.Files
sExt = LCase(oFSO.GetExtensionname(oFile.Name))
Select Case sExt
Case "xlsx", "xlsm"
Call AddData(oFile)
End Select
Next
For Each oSubfolder In Flder.Subfolders
DoEvents
Call ListFilesRecursive(oSubfolder)
Next
End Sub
Private Sub AddData(Fil As Object)
Dim wb As Workbook
Dim L As Long
oApp.ScreenUpdating = False
oApp.DisplayAlerts = False
oApp.EnableEvents = False
Set wb = oApp.Workbooks.Open(Fil, ReadOnly:=True)
With ws
L = .Cells(.Rows.Count, 1).End(xlUp).Offset(1, 0).Row
.Cells(L, 1).Value = Fil.Path
.Cells(L, 2).Value = Fil.DateLastModified
.Cells(L, 3).Value = wb.BuiltinDocumentProperties("Last Author")
End With
wb.Close False
Application.StatusBar = Fil.Path
End Sub