Excel VBA function to extract "Date taken" info from jpg files

Posted on 2014-10-16
Last Modified: 2014-10-17
hi there, I'm looking for a function to extract the "Date taken" info from jpg files, given the jpg URL.

function GetDateTaken(myURL)

It's been a while since i used VBA so a complete working function, if it's not many lines, would be great.

Question by:xenium
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
LVL 10

Expert Comment

by:Anthony Berenguel
ID: 40385759
GivenLocation = "c:\temp\" 'note the trailing backslash
OldFileName = "SomeFileName.xls"
NewFileName = "DifferentFileName.xls"
Name GivenLocation & OldFileName As GivenLocation & NewFileName

Open in new window

I have used this before.

Of course you'll need to modify this code to extract the date out of the file name.  In which format is the date presented in the file name?
LVL 14

Accepted Solution

Farzad Akbarnejad earned 500 total points
ID: 40385934
I import a class from into a sample macro enabled file and write your proper function in a module. I attached a sample with this comment. Press Alt+F11 to see its code and test the function in module.


Author Comment

ID: 40386326
hi Farzad, thanks that looks like it'll do the trick. I tried your sample and get error "User defined type not defined", and the following line is highlighted:

Public Property Get Tag(Optional ByVal ExifTag As EXIF_TAG) As Variant

Open in new window

Is there something else I need to do?

Thanks again.
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 14

Expert Comment

by:Farzad Akbarnejad
ID: 40386419
No. All you need I include it. Make sure that you enable content and macro (code) when load it in Excel. Probably by clicking on two buttons.

LVL 14

Expert Comment

by:Farzad Akbarnejad
ID: 40386424
You must use the function I add it to Genral module. You can testit using immediate window by pressing ctrl+g in code editor.

Author Comment

ID: 40386471
Oops sorry seems to work fine now! Thanks a millon!

Author Closing Comment

ID: 40386472
Good stuff thanks!
LVL 14

Expert Comment

by:Farzad Akbarnejad
ID: 40386854
Glad to help you. :)


Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.

736 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question