Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default GPS Data from JPEG's

I have a large number of JPEG files taken from various phones that have GPS latitude and longitude data. I can view this data by looking up the file properties (details) individually in windows explorer.

Is it possible to retrieve this GPS data in VBA? I would like to retrieve the latitude and longitude for each file into a spreadsheet.

I'm using Windows 7 and Excel 365.

I did see some old posts that seemed to relate but the links to solutions were no longer valid.


Thanks in advance.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default GPS Data from JPEG's

Il giorno luned́ 27 aprile 2015 04:16:46 UTC+2, ha scritto:
I have a large number of JPEG files taken from various phones that have GPS latitude and longitude data. I can view this data by looking up the file properties (details) individually in windows explorer.
Is it possible to retrieve this GPS data in VBA? I would like to retrieve the latitude and longitude for each file into a spreadsheet.
I'm using Windows 7 and Excel 365.
I did see some old posts that seemed to relate but the links to solutions were no longer valid.


Hi neilw...,
try:

Public Sub GetExtendedProperty_Test()
Const cstrPath As String = "D:\Path"
Const cstrFilename As String = "Filename.JPG"
Dim p As String

' System.Photo.CameraModel
p = GetExtendedProperty(cstrPath, _
cstrFilename, _
"{14B81DA1-0135-4D31-96D9-6CBFC9671A99}", _
272)
Debug.Print p

' System.GPS.Latitude
p = GetExtendedProperty(cstrPath, _
cstrFilename, _
"{8727CFFF-4868-4EC6-AD5B-81B98521D1AB}", _
100)
Debug.Print p

' System.GPS.Longitude
p = GetExtendedProperty(cstrPath, _
cstrFilename, _
"{C4C4DBB2-B593-466B-BBDA-D03D27D5E43A}", _
100)
Debug.Print p
End Sub

' Windows Properties
' https://msdn.microsoft.com/en-us/lib...77(VS.85).aspx
'
Public Function GetExtendedProperty(ByVal Path As String, _
ByVal Filename As String, _
ByVal formatID As String, _
ByVal propID As String)
Dim sh As Shell32.Shell
Dim fld2 As Shell32.Folder2
Dim fi As Shell32.FolderItem
Dim sfi As Shell32.ShellFolderItem

Set sh = CreateObject("Shell.Application")
Set fld2 = sh.Namespace(Path)
Set fi = fld2.ParseName(Filename)
Set sfi = fi
GetExtendedProperty = sfi.ExtendedProperty(formatID & CStr(propID))

Set sfi = Nothing
Set fi = Nothing
Set fld2 = Nothing
Set sh = Nothing
End Function

--
Ciao! :)
Maurizio
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,182
Default GPS Data from JPEG's

I have a large number of JPEG files taken from various phones that
have GPS latitude and longitude data. I can view this data by looking
up the file properties (details) individually in windows explorer.

Is it possible to retrieve this GPS data in VBA? I would like to
retrieve the latitude and longitude for each file into a spreadsheet.


I'm using Windows 7 and Excel 365.

I did see some old posts that seemed to relate but the links to
solutions were no longer valid.


Thanks in advance.


You need a file property reader, DsoFile.dll perhaps!

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
spreadsheet to jpeg yoursbydesign Excel Discussion (Misc queries) 6 July 6th 09 10:24 PM
Using jpeg images in Excel tgw4 Excel Discussion (Misc queries) 1 December 16th 07 01:29 AM
Importing JPEG data into spreadsheet [email protected] Excel Programming 4 August 12th 07 03:36 PM
GIF, JPEG, TNF -format Sige Excel Programming 2 September 30th 05 04:00 PM
How do I view a JPEG file from data selected in Excel gilg Excel Worksheet Functions 0 July 11th 05 09:51 PM


All times are GMT +1. The time now is 06:21 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"