Private Sub Form_Load()
Dim fso, ffolder, ffile
Dim dd As Date, sFilename As String
Set fso = CreateObject("Scripting.FileSystemObject")
Set ffolder = fso.getfolder("c:\")
For Each ffile In ffolder.Files
If ffile.datecreated > dd Then
sFilename = ffile.Name
dd = ffile.datecreated
Although both are almost the same (Richie and Shanock),
Shanock is retuned the correct value
joebenz
ASKER
To Richie,
I do not know why yours is 3 files short to the newest.
Richie_Simonetti
first of all, what do you need last modification date(shancock ) or which is the newest file?
I didn't get what you get, i got the last file that was created in that folder.
Cheers
Let me try it