Computer Science Canada

vba create full path

Author:  greenapplesodaex [ Mon Apr 18, 2005 10:33 am ]
Post subject:  vba create full path

how do i create a full path in vba?
say i want to make "c:\folder1\folder2\folder3\", if folder1 or folder2 is missing, it will give me error, is there a way so that it can fill in the missing folders automaticlly?

Author:  Cervantes [ Mon Apr 18, 2005 5:40 pm ]
Post subject: 

So, you want to make a folder at a specific location? Or do you want to make a bunch of folders that are within each other?
If it's the latter, you could just create them one by one within each other. Not too difficult. If it's the former, you could probably first use a DIR command to determine if a folder with the name you want already exists. If one doesn't exist, make it. Then put your next folder in there.

And what do you mean by automatically? Are you trying to tell the vba in one line to "make a directory at C:\f1\f2\f3 and if f1 or f2 doesn't exist, make it"? If so, I doubt vba can do it. If it can, dandy!


: