Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 221
  • Last Modified:

Folder Creator

I need to code to check if a folder exists and if the folder doesnt create it!!! thanx in advance

Text1.Text = the path
0
burnttime
Asked:
burnttime
1 Solution
 
TwistD_PissRCommented:
Dim FSO As Object
Dim sNewFolder As String
   
  sNewFolder = Text1.Text
  Set FSO = CreateObject("Scripting.FileSystemObject")
  If Not FSO.FolderExists(sNewFolder) Then
    FSO.CreateFolder sNewFolder
  End If
  Set FSO = Nothing



TwistD
0
 
vinnyd79Commented:
Why not just use:

If Dir(Text1.Text, vbDirectory) = "" Then MkDir Text1.Text



0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now