Why I wouldn't normally answer a code-less question I found this interesting.
On Windows 7 I can get the DateTaken
using Shell
below. I know from prior experience (see get list of subdirs in vba) the Detailsof
can vary by OS.
Pls update the code below to point at your directory (currently c:\temp)
This works for me, but does leave additional characters (?
or CHR63
) in the date field that I'm yet to manage to clean)
Sub JPG_Details()
Dim objShell As Object
Dim objFolder As Object
Dim objFolderItem As Object
Dim lngCnt As Long
'If StrDir is dimensioned as a string, ParseName fails. Weird but true
Dim strDir
Dim strFile As String
Dim X(1 To 10000, 1 To 3)
Set objShell = CreateObject("shell.application")
strDir = "C:\temp\"
Set objFolder = objShell.Namespace(strDir)
strFile = Dir(strDir & "*.jpg")
Do While Len(strFile) > 0
lngCnt = lngCnt + 1
Set objFolderItem = objFolder.ParseName(strFile)
X(lngCnt, 1) = strFile
X(lngCnt, 2) = Split(objFolder.GetDetailsOf(objFolderItem, 12), " ")(0)
X(lngCnt, 3) = Split(objFolder.GetDetailsOf(objFolderItem, 12), " ")(1)
strFile = Dir
Loop
[a1].Resize(UBound(X, 1), UBound(X, 2)).Value2 = X
End Sub