Hi all,
I have searched but can't find an answer to this.
If I have a string containing a file path. eg "R:\Administration\Timekeeping\test.xls" How do I check that the path exists?
If the computer running the app is not connected to the network, and hence the path doesn't exist, then using this code
If Len(Dir$(strFilePath)) > 0 ThenCode:Public Function FileExists(strFilePath As String) As Boolean FileExists = False 'Assume the worst! 'Make sure a filename was passed! If Len(strFilePath) > 0 Then 'Check to see if the file exists! If Len(Dir$(strFilePath)) > 0 Then 'The file exists! FileExists = True End If End If End Function
still creates an error "bad file name or number"
Can someone suggest a way of finding out whether or not a path exists?




Reply With Quote