Function fileexists(ByVal path As String) As boolean
Dim x As Long
x = FreeFile
On Error Resume Next
Open path$ For Input As x
If Err = 0 Then
fileexists = True
Else
fileexists = False
End If
Close x
End Function