I currently use this code to see if a file exists:

Public Function FileExist(sData As String) As Boolean
On Error Resume Next
If sData <> "" Then
File = Len(Dir$(sData))
If Err Or File = 0 Then
FileExist = False
Else
FileExist = True
End If
End If
End Function

but if i want to use it to see if a directory exists it never works, is there a proper way to do this ?