mauricionava
Programmer
Hello, I have a form that first it gets the name of the file and stores it in a variable. When I try to do the fso.MoveFile (<souce folder> & <name of the file>),<destination folder> it does not work. If I say "\*.*" it will move all files in the source folder but I only want to move the one in the variable. How can I do that?
Thanks.
Thanks.
Code:
If fldr.files.count >= numberOfFiles Then
For Each fil In fldr.files
If Right(fil.ShortName, 3) = "TIF" Then
If fil.DateLastModified < oldestDate Then
oldestFile = fil.path
oldestDate = fil.DateLastModified
End If
End If
Next
ShowFileList = oldestFile
MsgBox oldestFile ' show me file name in a msgbox
filename = oldestFile
fso.MoveFile (sfolder & fso.GetFileName(oldestFile)), dfolder
End If