Getting a File Date & Time stamp

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi
Is it possible to get a file date & time stamp info (any particular file
stored on harddrive) from within VBA. How??

Thats a lot for your help

James
 
Hi:
From the vba online help:
'------------------------------
Sub ShowFileInfo()
Dim fs, f, s
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFile("E:\Computer\Archive\Graphics\VCRPause.bmp")
s = f.DateCreated
MsgBox s
End Sub
'-------------------------------

See online-help for the File Object.
Regards,
Sebastienm
 
Try:

Function TS()
Set fso = CreateObject("Scripting.FileSystemObject")
TS = fso.GetFile("c:\aa.txt").datecreated
Set fso = Nothing
End Function

NB: Modify the function so that the fully qualified name of your file is
passed in as an argument.
 
Tom,

Is there a similar function to retrieve the date and time a file was last
modified and by whom?

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top