Thread: [Solved] Define New Valid Folder Name
View Single Post
 
Old 01-11-2016, 10:56 PM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,142
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

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.
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote