Hello everyone,
I found a code below from the site which is expected to change all files names in a folder by attaching the file modified date to the file name:
Sub RenameFiles()
Dim objShell As Object
Dim objFolder As Object
Dim objFile As Object
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(ThisWorkbook.Path)
For Each objFile In objFolder.Items
If objFile.Name <> ThisWorkbook.Name Then
Name objFolder.GetDetailsOf(objFile, 0) As _
Replace(objFolder.GetDetailsOf(objFile, 0), ".", _
CStr(Format(objFolder.GetDetailsOf(objFile, 3), " yyyy-mm-dd.")))
End If
Next objFile
End Sub
The link is:
But every time I was trying to run it, it said: Run-time error '53': File not found
I believe I did follow the procedure properly. Not sure why there is an error like this. I do have files in the folder where the workbook of the macro is saved.
Bookmarks