Loading

Tuesday, March 17, 2009

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

SHARE TWEET

Thank you for reading this article Determining whether a path exists With URL https://x-tutorials.blogspot.com/2009/03/determining-whether-path-exists.html. Also a time to read the other articles.

0 comments:

Write your comment for this article Determining whether a path exists above!