Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 533
  • Last Modified:

Rename folder with VBA

I have a folder as follows C:\NewFolder  This is found in Cell A2.
Cell A5 has the path to this folder C:\
I am trying to rename folder 'NewFolder' to 'FolderX'
My code is attached.   I get a File not Found error.
Please tell me what I am doing wrong.  Thanks!

Name (Range("A2").Value As Range("A5").Value & "FolderX"

Open in new window

0
davidam
Asked:
davidam
  • 2
1 Solution
 
Rory ArchibaldCommented:
Are you sure the path is correct - e.g. it's definitely "NewFolder" and not "New Folder" with a space?
0
 
Rory ArchibaldCommented:
PS I'm assuming that parenthesis between Name and Range is a typo and isn't actually in your code, since it wouldn't compile otherwise.
0
 
davidamAuthor Commented:
Yes, it was just sloppiness on my part.  The code works fine if it is done properly.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now