Getting file created date (1 Viewer)

gsrajan

Registered User.
Local time
Today, 10:34
Joined
Apr 22, 2014
Messages
227
I am able to get the files names from Windows Explorer using http://allenbrowne.com/ser-59.html function. Is it possible to get the file created date also? Thank you.
 

gsrajan

Registered User.
Local time
Today, 10:34
Joined
Apr 22, 2014
Messages
227
Thank you, I will try that and let you know.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 10:34
Joined
Feb 19, 2002
Messages
43,233
You can get all properties of a file by using FSO

Dim FSO As New FileSystemObject
Dim fs As Scripting.FileSystemObject
Dim folder As Scripting.folder
Dim file As Scripting.file
Dim filefolder

Set fs = CreateObject("Scripting.FileSystemObject")
Set folder = fs.GetFolder(SourceFolderPath)
Set filefolder = folder.Files

For Each file In filefolder


The code routine is too complicated and long to post so I just pulled out the Dims, sets, and For Each to show you how to reference a file using FSO
Then to get the properties is:

file.propertyname ' you'll get intellisense and DateCreated should be the property you want.


You will need a reference to either Microsoft Scripting Runtime or Microsoft Office xx.o Object Library (I can't remember which offhand)
 

Users who are viewing this thread

Top Bottom