Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get Date of a text file from within Excel 3

Status
Not open for further replies.

JVFriederick

IS-IT--Management
Mar 19, 2001
517
US
Each day a summary of parameters from within an Excel pricing model are saved to a text file and then archived into a database for long term storage.

I need to modify the pricing model significantly, and the layout of the text file will also change.

I was wondering if anyone knows how to check a file using VB within Excel to determine the DATE and TIME of the text file?

Thanks
 
Try the following :

Dim OFso As Object
Dim oFile As Object
Set OFso = CreateObject("Scripting.FileSystemObject")
Set oFile = OFso.GetFile(&quot;FileName&quot;) ' <- enter full path & name of the file
MsgBox &quot;File last modified: &quot; & oFile.DateLastModified
 
Wow. Works great and then some.

You're a champion!

Thanks !!!
 
Sweet, huh, JVF?

Nice to have that nut around isn't it? Oh, it says ACRON, not acorn!

LOL LOL

A star from me too, because if JVF asks the question, you KNOW it can't be easy!
 
Well, as if

Set OFso = CreateObject(&quot;Scripting.FileSystemObject&quot;)

just ROLLS off my tongue!!

I've wanted to know how to do this for...... about 3 years!!

I really appreciate it acron. If I could log in as somebody else I would give another star.
 
Now that I've had a chance to check this out, I too have to follow up with a &quot;STAR&quot;.

This is certainly a nice routine to have in my &quot;toolkit&quot;.

Thanks, AC, :)

Might you consider posting it as a FAQ ???

Regards, ...Dale Watson dwatson@bsi.gov.mb.ca
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top