Results 1 to 19 of 19

Thread: Check for folder; create if it does not exist

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Hi,

    im quite new too. try this

    Public Sub createNewDirectory(directoryName As String)
    If Not DirExists(directoryName) Then 
    MkDir (directoryName)
    End If
    End Sub
     
    Function DirExists(DirName As String) As Boolean
    On Error GoTo ErrorHandler
    DirExists = GetAttr(DirName) And vbDirectory 
    ErrorHandler: 
    End Function
    hope this helps

    Last edited by Aussiebear; 11-18-2018 at 07:25 PM. Reason: Added correct tags to posted code

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •