View Single Post
 
Old 12-05-2022, 08:25 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,977
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

The code provided by omegastripes on this stackoverflow thread works when the image has the GPS data on it
Excel VBA open folder and get GPS info (Exif) of each files in it (2) - Stack Overflow

The code was using late binding to make use of a library called 'Microsoft Windows Image Acquisition Library'
Code:
Sub Test()
    With CreateObject("WIA.ImageFile")
        .LoadFile "C:\Test\image.jpg"
        With .Properties("GpsLatitude").Value
            Debug.Print .Item(1).Value + .Item(2).Value / 60 + .Item(3).Value / 3600
        End With
        With .Properties("GpsLongitude").Value
            Debug.Print .Item(1).Value + .Item(2).Value / 60 + .Item(3).Value / 3600
        End With
    End With
End Sub
When I tried it on some image files without GPS data it errors so an error checker will be required.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote