Avatar of chestera
chestera
 asked on

Rename and Delete sub folders

Hi

I have folders on dropbox. as follows
C:\Users\Public\Dropbox\Client\DirectSales\EnvirpPacific.

My question is how can I using vba change the name or delete the folder EnviroPacific

I can change a root folder name
Dim strOldDirName As String
Dim strNewDirName As String
 
strOldDirName = "C:\Zmyfolder"

strNewDirName = "C:\Pfolder"
Name strOldDirName As strNewDirName

I get errors when I add Sub folders.

Any help would be appreciated

chestera
Microsoft DevelopmentMicrosoft Access

Avatar of undefined
Last Comment
chestera

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Scott McDaniel (EE MVE )

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
Jim Dettman (EE MVE)

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
chestera

ASKER
Jim Dettman

My apologies. With my example I got and error on the last line Name path not found although the path was or looked correct so I rewrote as follows

Dim strOldDirName As String
Dim strNewDirName As String

strOldDirName = "C:\FolderA\FolderB"

strNewDirName = "C:\FolderA\FolderC\"
Name strOldDirName As strNewDirName

This time no problems. Must have been a glitch in my first attempt

I will split the points

Alan
chestera

ASKER
many thanks feeling a bit foolish
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23