Public Function cekfile(dor As String, fil As String)
Dim i
With Application.FileSearch
.LookIn = dor
.FileName = fil
If .Execute(SortBy:=msoSortByFileName, _
SortOrder:=msoSortOrderAscending) > 0 Then
‘MsgBox “There were ” & .FoundFiles.Count & _
‘ ” file(s) found.”
For i = 1 To .FoundFiles.Count
‘ MsgBox .FoundFiles(i)
Next i
GoTo betul
Else
GoTo salah
End If
End With
betul:
cekfile = True
GoTo bye
salah:
cekfile = False
GoTo bye
bye:
End Function





