On what basis is the foldername being created? Is it just a random sequence of letters or letters and numbers, or is there some method behind it?
The FolderExists function on my web site -
http://www.gmayor.com/useful_vba_functions.htm will check if the folder name exists, and can be used to quit if the folder name exists. You can adapt the FileNameUnique function to work with Foldernames to append a number if the name exists and the CleanFilename function to vet a name for illegal filename characters, but really it is the original naming that is the main issue.