Wednesday, March 18, 2009

Excel VBA: Determining whether a path exists

To check whether a path exists or not, we can use Excel VBA's GetAttr function. The following function returns True if a specified path exists, and return False otherwise:

Function isPathExist(ByVal pathname As String) As Boolean
 On Error Resume Next
 isPathExist = GetAttr(pathname) And vbDirectory = vbDirectory
End Function

Related posts:

If you like posts in this blog, you can to support me :)


  1. Hi thanks for your tips For macro

    i also working in excel, i know very well of excel but macro now only i know so i don't know many of things in macro so pls guide me fundamental of macro i also have blog

    if you have possible pls guide me

  2. i want one macro code for

    how will merge the multiple rom in single cell in excel pls tell me friends

    advance thanks for you