NAME oldpathname As newpathname

Renames an existing file or directory.


oldpathnameThe full pathname of the file or directory you want to rename (String).
newpathnameThe full pathname of the file or directory to be created (String).

REMARKS
* If you try to rename a file that is currently open you will get a run-time error.
* If you try to rename a file that does not exist you will get a file not found error.
* This subroutine can only be used to rename an existing directory when both the old and new exist on the same drive.
* What happens if the directories do not exist ??
* This statement cannot be prefixed with "VBA."
* For the Microsoft documentation refer to docs.microsoft.com

Name "text.txt" As "test2.txt" 
Name "C:\Temp\" As "C:\Temp2\"

© 2020 Better Solutions Limited. All Rights Reserved. © 2020 Better Solutions Limited Top