N
Nigel
Does anyone know the rules for application file search, I have a curious
result from the following search in my application. If the string
'audit.csv' appears in any file in the chosen path I get True as file
exists. Despite not including wild cards in the search string filename.
My test reveal the following:
1. audit.csv =True
2. xxaudit.csv =True
3. auditxx.csv =False
I would have expected option 2 to return False, is there something I should
do in addition to fix this ?
' search for the audit.csv file if it exists
Dim vFileExists As Boolean
Application.FileSearch.LookIn = vPath
Application.FileSearch.Filename = "audit.csv"
If Application.FileSearch.Execute > 0 Then
vFileExists = True
Else
vFileExists = False
End If
result from the following search in my application. If the string
'audit.csv' appears in any file in the chosen path I get True as file
exists. Despite not including wild cards in the search string filename.
My test reveal the following:
1. audit.csv =True
2. xxaudit.csv =True
3. auditxx.csv =False
I would have expected option 2 to return False, is there something I should
do in addition to fix this ?
' search for the audit.csv file if it exists
Dim vFileExists As Boolean
Application.FileSearch.LookIn = vPath
Application.FileSearch.Filename = "audit.csv"
If Application.FileSearch.Execute > 0 Then
vFileExists = True
Else
vFileExists = False
End If