richarddawson
Board Regular
- Joined
- Oct 18, 2014
- Messages
- 95
Sub getCountryFile()
Dim filePath As String
filePath = "z:\allUK\EVR"
If Len(Dir(filePath)) > 0 Then
Workbooks.Open (filePath)
Else
Debug.Print "doesn't exist"
End If
End Sub
Where filePath is valid, and the Workbooks.Open works fine if tried outside the If.
But "doesn't exist" comes up in every situation.
Dim filePath As String
filePath = "z:\allUK\EVR"
If Len(Dir(filePath)) > 0 Then
Workbooks.Open (filePath)
Else
Debug.Print "doesn't exist"
End If
End Sub
Where filePath is valid, and the Workbooks.Open works fine if tried outside the If.
But "doesn't exist" comes up in every situation.