Function FileDetail(ByVal FilePath As String, ByVal index As Long)
On Error Resume Next
Dim fldName As String, fleName As String
With CreateObject("Scripting.FileSystemObject")
fldName = .GetFile(FilePath).ParentFolder.Path
fleName = .GetFile(FilePath).Name
End With
With CreateObject("Shell.Application")
With .Namespace("" & fldName & "")
FileDetail = .Getdetailsof(.ParseName("" & fleName & ""), index)
End With
End With
End Function
Sub PicDetailsList()
Dim vFolder, arrFiles, aIndex
Dim rngFind As Range
Dim lR As Long, lC As Long, n As Long, lCountFiles As Long, index As Long
Dim tmp1 As Date, tmp2 As Date, t As Double
Dim sFile As String
On Error Resume Next
[COLOR=#ff0000]aIndex = Array(177, 0, 3, 182, 1, 31)[/COLOR]
With CreateObject("Shell.Application")
vFolder = .BrowseForFolder(0, "", 1).Self.Path
End With
If TypeName(vFolder) = "String" Then
t = Timer
arrFiles = FilesFoldersList(CStr(vFolder), True, "*.*", False)
If IsArray(arrFiles) Then
lCountFiles = UBound(arrFiles) + 1
ReDim aRes(1 To lCountFiles + 1, 1 To 6)
For n = 1 To lCountFiles
sFile = CStr(arrFiles(n - 1))
If UCase$(Right$(sFile, 4)) = ".JPG" Or _
UCase$(Right$(sFile, 4)) = ".BMP" Or _
UCase$(Right$(sFile, 4)) = ".PNG" Then
lR = lR + 1
aRes(lR, 1) = FileDetail(sFile, aIndex(0))
aRes(lR, 2) = FileDetail(sFile, aIndex(1))
tmp1 = DateValue(FileDetail(sFile, aIndex(2)))
tmp2 = TimeValue(FileDetail(sFile, aIndex(2)))
aRes(lR, 3) = tmp1 + tmp2
aRes(lR, 4) = FileDetail(sFile, aIndex(3))
aRes(lR, 5) = FileDetail(sFile, aIndex(4))
aRes(lR, 6) = FileDetail(sFile, aIndex(5))
End If
Next
If lR > 0 Then
With Sheets("List")
.Range("A2:F60000").Clear
.Range("A2").Resize(lR, 6).Value = aRes
.Columns("A:F").AutoFit
End With
MsgBox "Done!", , Timer - t
End If
End If
End If
End Sub