Hello!
I'm trying to use this code to copy a file from one location to another. I've done this before with exact file path names but because these files have an unpredictable timestamp I cannot predict the entire name.
The true file name is P01 List202108 0200.csv. I've tried adding a ? or a * in multiple places around the 0200 and I get the same error path not found error.
Any idea where I may be going wrong?
Sub CopyK()
Dim fso As Object
Set fso = CreateObject("Scripting.FileSystemObject")
fso.CopyFile "C:\Users\fypw53\Desktop\K\P01 List20210208 *.csv", [I5]
Set fso = Nothing
End Sub
I'm trying to use this code to copy a file from one location to another. I've done this before with exact file path names but because these files have an unpredictable timestamp I cannot predict the entire name.
The true file name is P01 List202108 0200.csv. I've tried adding a ? or a * in multiple places around the 0200 and I get the same error path not found error.
Any idea where I may be going wrong?
Sub CopyK()
Dim fso As Object
Set fso = CreateObject("Scripting.FileSystemObject")
fso.CopyFile "C:\Users\fypw53\Desktop\K\P01 List20210208 *.csv", [I5]
Set fso = Nothing
End Sub