Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 542
Default Getting a File Date & Time stamp

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 694
Default Getting a File Date & Time stamp

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

"James" wrote:

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 400
Default Getting a File Date & Time stamp

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.

"James" wrote:

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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Getting a File Date & Time stamp

VBA's function:

FileDateTime(pathname)

--
Regards,
Tom Ogilvy

"James" wrote in message
...
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



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 441
Default Getting a File Date & Time stamp

Tom,

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

Thanks

"Tom Ogilvy" wrote:

VBA's function:

FileDateTime(pathname)

--
Regards,
Tom Ogilvy

"James" wrote in message
...
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






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Getting a File Date & Time stamp

If you mean any file:

See Ivan Moala's page
http://www.xcelfiles.com/Shell32_01.html
http://www.xcelfiles.com/Shell32_02.html

--
Regards,
Tom Ogilvy

"quartz" wrote in message
...
Tom,

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

Thanks

"Tom Ogilvy" wrote:

VBA's function:

FileDateTime(pathname)

--
Regards,
Tom Ogilvy

"James" wrote in message
...
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






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Time date stamp naslami Excel Worksheet Functions 0 October 6th 09 03:11 AM
Date-Time Stamp [email protected] Excel Discussion (Misc queries) 1 September 27th 06 02:37 PM
date/time stamp Jan Excel Worksheet Functions 7 July 14th 05 01:04 PM
Date time stamp Frank Kabel Excel Programming 3 March 1st 04 08:56 PM
Date time stamp Chip Pearson Excel Programming 0 March 1st 04 04:14 PM


All times are GMT +1. The time now is 04:28 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"