Hello,
I have the following code to rename an existing folder but it gives me error in the line: OldFolderName As NewFolderName. Can I please have your help to make it work?
Thank you.
I have the following code to rename an existing folder but it gives me error in the line: OldFolderName As NewFolderName. Can I please have your help to make it work?
Thank you.
Code:
Private Sub CommandButton1_Click()
If Me.ComboBox1.Value = "" Then
MsgBox "CAR can Not be Blank!", vbExclamation, "CAR"
Dim OldFolderName As String, NewFolderName As String
Dim CAR As String
CAR = ComboBox1.Text
'Set Folder Names
OldFolderName = "Z:\Document\Department\CAR Project\CAR Folders\" & CAR
NewFolderName = ""Z:\Document\Department\CAR Project\CAR Folders\"" & CAR & "-Closed"
'Rename them
OldFolderName As NewFolderName
End Sub