I am trying to rename a dynamic file within VBA code. The structure of this dynamic file is as below, and to what it should be renamed to
I have searched many places to look for renaming in VBA code for excel but couldn't find.
I tried File copy method and using wildcard and it errors out for the following code :
FileCopy "\C:\Users\User12345\Desktop\ReportFolder*.csv*", "C:\Users\User12345\Desktop\ReportFolder\Daily_Report.csv"
RunTime Error 52 : Bad Filename or Number
Any help is appreciated. Thanks.