MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Using file properties in a macro


Posted by Brian Charles on March 17, 2000 9:51 AM

If you look at the properties of a file from the
"File" menu, it gives dates and times of creation
and modification, so they must be somewhere.
Can they be accessed from within VBA? If so, how....


Posted by judi on March 17, 2000 12:31 PM

From the Microsoft Excel VBA help:

This example uses the FileDateTime function to determine the date and time a file was created or last modified. The format of the date and time displayed is based on the locale settings of your system.

Dim MyStamp
' Assume TESTFILE was last modified on February 12, 1993 at 4:35:47 PM.
' Assume English/U.S. locale settings.
MyStamp = FileDateTime("TESTFILE") ' Returns "2/12/93 4:35:47 PM".