I have the below code which lists all the file names (minus file extension) and also the image dimensions – don’t get me wrong, it works, but it takes a couple of hours to list the file names and dimensions for 1,100 png images. I just wondered if there was any quicker way in which to do this? I’m not sure how to go about it in all honesty.
Sub Get_Properties_Men()
Dim sFile As Variant
Dim oShell As Object, oDir As Object
Dim i As Long
Set oShell = CreateObject("Shell.Application")
Set oDir = oShell.Namespace("W:Gegenpress Graphics-- Crests MasterClubs")
i = 4
For Each sFile In oDir.Items
Cells(i, 1).Value = sFile.Name
Cells(i, 2).Value = sFile.ExtendedProperty("Dimensions")
i = i + 1
Next
Set oShell = CreateObject("Shell.Application")
Set oDir = oShell.Namespace("W:Gegenpress Graphics-- Crests MasterCompetitions")
i = 4
For Each sFile In oDir.Items
Cells(i, 4).Value = sFile.Name
Cells(i, 5).Value = sFile.ExtendedProperty("Dimensions")
i = i + 1
Next
MsgBox "Men's crests and competitions added."
End Sub