is it possible to have a macro create a folder named myfolder in c:\?
in case, a folder named myfolder already exists in c:\, then it should not overwrite. the folder should be created only if it doesn't exist.
can anyone help, please!
TIA.
is it possible to have a macro create a folder named myfolder in c:\?
in case, a folder named myfolder already exists in c:\, then it should not overwrite. the folder should be created only if it doesn't exist.
can anyone help, please!
TIA.
You need a FileSystemObject to do this. Declare for example like this
Dim FilSysObj As Scripting.FileSystemObject
then
Set FilSysObj = New Scripting.FileSystemObject
You can then use the Createfolder function
FilSysObj .Createfolder ("YourPath")
The statement will not overwrite en exisiting folder with the same name. To prevent error msg in case the folder already exist use
on error resume next
before you create the folder
Remember to use Microsoft scripting Runtime something in Tools --> References
Last edited by hke; 03-02-2005 at 10:57 AM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks