Hi ex(cel)perts.
I got the following code to check existing file to be opened.
But failed for one of the file on mapping drive
For example I want to check S:\Files\zTB Group.xls, it failed.
But on other file S:\Files\TB Group.xls it succeded
May I know why? It's been bugging me this whole day.
Thanks in advance
-sea-
I got the following code to check existing file to be opened.
But failed for one of the file on mapping drive
For example I want to check S:\Files\zTB Group.xls, it failed.
But on other file S:\Files\TB Group.xls it succeded
May I know why? It's been bugging me this whole day.
Code:
Function Control_IsFile_Exist(ByVal path As String)
Dim value As Boolean
If Dir$(path, vbDirectory) <> "" Then
value = True
ElseIf Dir$(path & ".xls", vbDirectory) <> "" Or Dir$(path & ".xlsx", vbDirectory) <> "" Or Dir$(path & ".xlsm", vbDirectory) <> "" Then
value = True
Else
value = False
End If
Control_IsFile_Exist = value
End Function
Thanks in advance
-sea-