S
signon77
Here's the deal.
I'm attempting to move backwards through the fso files collection but
getting an "invalid procedure call" error. Here's the code I'm
struggling with:
Dim objFso As FileSystemObject
Dim objFolder As Folder
Dim objFile As File
Dim z As Long
Set dTPlusOneFiles = New Dictionary
'Count backwards through the files collection to get the four most
recently created files
For z = objFolder.Files.Count To 1 Step -1
Set objFile = objFolder.Files(z)
dTPlusOneFiles.Add objFile.Name, objFile.DateCreated
Next z
Strangely the error message occurs at this point: "Set objFile =
objFolder.Files(z)"
Any assistance will be gratefully appreciated.
Rob
I'm attempting to move backwards through the fso files collection but
getting an "invalid procedure call" error. Here's the code I'm
struggling with:
Dim objFso As FileSystemObject
Dim objFolder As Folder
Dim objFile As File
Dim z As Long
Set dTPlusOneFiles = New Dictionary
'Count backwards through the files collection to get the four most
recently created files
For z = objFolder.Files.Count To 1 Step -1
Set objFile = objFolder.Files(z)
dTPlusOneFiles.Add objFile.Name, objFile.DateCreated
Next z
Strangely the error message occurs at this point: "Set objFile =
objFolder.Files(z)"
Any assistance will be gratefully appreciated.
Rob