Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

If folder exist don't allow to create

Status
Not open for further replies.

peryan77

Programmer
May 7, 2004
41
0
0
US
How would I go about allowing a user to create a folder in a given directory, but only if it does not already exist?
 
Use code such as the following:
Code:
If Dir("C:\Data\Mystuff", vbDirectory) <> "" Then
  ' create the folder
  MkDir "C:\Data\Mystuff"
End If

John
 
Or

On Error Resume Next
MkDir "C:\Data\Mystuff"

Craig
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top