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.
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

717 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