ckchew666
asked on
Copy file and rename it using VB
Hi,
I'd like to copy an existing (*'xls) file from a folder [C:\nbutane\rsview\report\ ] into the same folder but the new file will be rename.
FileCopy "C:\nbutane\rsview\report\ FC Daily Report.xls", "C:\nbutane\rsview\report\ FC Daily Report\" & Format(Date - 1, "ddmmmmyyyy") & ".xls"
End Sub
Source (original filename) : FC Daily Report.xls
Target (new filename) : FC Daily Report.xls 07112004.xls
Anyone can verify if the VB code above is correct? Thx.
I'd like to copy an existing (*'xls) file from a folder [C:\nbutane\rsview\report\
FileCopy "C:\nbutane\rsview\report\
End Sub
Source (original filename) : FC Daily Report.xls
Target (new filename) : FC Daily Report.xls 07112004.xls
Anyone can verify if the VB code above is correct? Thx.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Not really part of your question but you may find formatting the date as yyyymmdd will help you when it comes to sorting the list of files alphabeticallu, they will appear in date order.
ASKER
Vippx,
Thx for ur code, you are realy good :)
Thx for ur code, you are realy good :)