Sub GetFileInfo()
'Reference: Microsoft Shell Controls and Automation - C:\Windows\SysWOW64\shell32.dll
Dim objShell As New Shell
Set FS = CreateObject("Scripting.FileSystemObject")
strFolder = "C:\Pictures\desktopbackground\"
strTemp = "20170212_135a.jpg"
Rw = 2
Set Fl = FS.GetFile(strFolder & strTemp)
Worksheets("Src").Cells(Rw, 2).Value = strFolder
Worksheets("Src").Cells(Rw, 3).Value = strTemp
Worksheets("Src").Cells(Rw, 4).Value = Fl.DateLastModified
Debug.Print Fl.Type
If Fl.Type = "JPEG image" Or Fl.Type = "PNG image" Or Fl.Type = "GIF image" Or Fl.Type = "JPG-bestand" Then
'Images only
Set objFolder = objShell.Namespace(strFolder)
Set objFile = objFolder.ParseName(strTemp)
iPictureSize = objFile.ExtendedProperty("Dimensions")
iLat = objFile.ExtendedProperty("{8727CFFF-4868-4EC6-AD5B-81B98521D1AB}100")
iLng = objFile.ExtendedProperty("{C4C4DBB2-B593-466B-BBDA-D03D27D5E43A}100")
If Not IsEmpty(iLat) Then
LatDec = iLat(0) + iLat(1) / 60 + iLat(2) / 3600
Else
LatDec = 0
End If
If Not IsEmpty(iLng) Then
LngDec = iLng(0) + iLng(1) / 60 + iLng(2) / 3600
Else
LngDec = 0
End If
Worksheets("Src").Cells(Rw, 5).Value = Val(Mid(iPictureSize, 2, InStr(iPictureSize, "x") - 2))
Worksheets("Src").Cells(Rw, 6).Value = Val(Mid(iPictureSize, InStr(iPictureSize, "x") + 1))
Worksheets("Src").Cells(Rw, 7).Value = LatDec
Worksheets("Src").Cells(Rw, 8).Value = LngDec
Set objFile = Nothing
Set objFolder = Nothing
End If
End Sub