View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Sharad Sharad is offline
external usenet poster
 
Posts: 123
Default Get the properties from a closed file

Hi,

You can use code as under - modify the filename with full path, as
needed.

Sub FileProps()
Dim fs
Dim dtCreated As Date, dtModified As Date, dtAccessed As Date
Set fs = CreateObject("Scripting.FileSystemObject")
Set d = fs.GetFile("c:\Book1.xls")
dtCreated = d.DateCreated
dtModified = d.DateLastModified
dtAccessed = d.DateLastAccessed
MsgBox "Created on " & dtCreated & ", Last Modified on " & _
dtModified & ", Last Accessed on " & dtAccessed

End Sub

Sharad



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!