PDA

View Full Version : Extract GPS data from jpeg file properties with VBA?



wdeleo
04-11-2010, 07:43 PM
Greetings all,

I need to use vba from within excel to extract jpeg file gps data (i.e. latitude and longitude) contained under file properties. I have founds some bits of code but nothing that specifically grabs the gps data. Can anyone advise?

TIA,
WD

stanl
04-12-2010, 02:48 AM
One option is to check if you have the wiaaut.dll on your system, otherwise download and register it. You can then

oIMG = CreateObject("WIA.ImageFile.1")
oIMG.LoadFile cJPG 'cJPG is path\filename of your image file

and after that flesh out the GPS tags (assuming the device that took the picture had GPS enabled). I'm no digital camera expert, but I think GPS is more likely associated with TIFF than JPEG. .02 Stan

macropod
04-12-2010, 03:15 AM
See also: http://lounge.windowssecrets.com/index.php?showtopic=618967 (mhtml:{2603C627-B617-484B-B3E3-521BCFB808E8}mid://00000208/!x-usc:http://lounge.windowssecrets.com/index.php?showtopic=618967)

mdmackillop
04-12-2010, 03:46 AM
I came across this information (http://www.everythingaccess.com/tutorials.asp?ID=Accessing-detailed-file-information-provided-by-the-Operating-System) a while ago, but never tried it out yet.

wdeleo
04-12-2010, 06:04 PM
Thank you, thank you, thank you. The leads posted here lead us to the code described below, and 18 hours later we have a fully functional (and damn slick) solution. You guys rock. WD ************************************************** ' * ------------ FilePropertyExplorer for Microsoft(r) VBA -------- * ' * ------------ (c) Wayne Phillips / iTech Masters 2010 ------- * ' * ------------ .everythingaccess.com ------ * ' **************************************************

mdmackillop
04-13-2010, 10:24 AM
Glad to help out. Can you post your code for the benefit of others?