CHRIS RAE'S VBA PAGES

Routine Archive


Routine:DirExists
Parameters:ByVal strDirName As String
Description: Check whether the specified path exists.

Function DirExists(ByVal strDirName As String) As Boolean
    ' Chris Rae's VBA Code Archive - http://chrisrae.com/vba
    ' Code from the Deployment Wizard, passed on by Will Rickards.
    On Error Resume Next

    DirExists = (GetAttr(strDirName) And vbDirectory) = vbDirectory

    Err.Clear
End Function

You're free to use these routines for anything you want - all I ask is that for commercial use you give me credit somewhere. You may instead want to head back to the index for my Visual Basic for Applications Pages or the main routines archive page.