Hi all,
Here is my script...
Sub renameBC()
year_Month = Format(DateAdd("m", 1, Date), "yyyy mmm")
yearMonth = Format(DateAdd("m", 1, Date), "yyyymmm")
Yr = Format(Application.WorksheetFunction.EoMonth(Date, 1), "yyyy")
Mnth = Format(Application.WorksheetFunction.EoMonth(Date, 1), "mmm")
'
Dim ObjFso
Dim SourcePath As String
Dim DestPath As String
'
SourceFileName = "BC_*.txt"
SourceLocation = "\\san\PPC_VENDOR\"
DestinationFileName = "vendor_ins_" & yearMonth & "_v56.txt"
DestinationLocation = "\\san\PPC\PPC WORK BASKETS\Forms and Files\" & Yr & "\" & Yr & " " & Mnth & "\Vendor Recon Files\"
SourcePath = SourceLocation & SourceFileName
DestPath = DestinationLocation & DestinationFileName
'
Set ObjFso = CreateObject("Scripting.FileSystemObject")
ObjFso.CopyFile SourcePath, DestPath
'
End Sub
This script works, however, it does not rename the file.
Do you have any ideas?
JD