Solved

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

Posted on 2014-10-16
8
1,438 Views
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.

Thanks!
0
Comment
Question by:xenium
  • 4
  • 3
8 Comments
 
LVL 10

Expert Comment

by:Anthony Berenguel
Comment Utility
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.
Source http://www.mrexcel.com/forum/excel-questions/586216-excel-visual-basic-applications-rename-existing-file.html

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?
0
 
LVL 14

Accepted Solution

by:
Farzad Akbarnejad earned 500 total points
Comment Utility
Hello,
I import a class from http://sourceforge.net/projects/exifclass/ 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.

-FA
sample.xlsm
0
 

Author Comment

by:xenium
Comment Utility
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.
0
 
LVL 14

Expert Comment

by:Farzad Akbarnejad
Comment Utility
Hi,
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.

-FA
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 14

Expert Comment

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

Author Comment

by:xenium
Comment Utility
Oops sorry seems to work fine now! Thanks a millon!
0
 

Author Closing Comment

by:xenium
Comment Utility
Good stuff thanks!
0
 
LVL 14

Expert Comment

by:Farzad Akbarnejad
Comment Utility
Glad to help you. :)

-FA
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Sparklines have been introduced with Excel 2010 and are a useful tool for creating small in-cell charts, used for example in dashboards. Excel 2010 offers three different types of Sparklines: Line, Column and Win/Loss. What it does not offer is a…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…

743 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now