If this is only for that little macro it's probably not worth adding the reference to the project, use late binding instead:
Code:
Sub CheckFileExist()
Dim MyFSO As Object
Set MyFSO = CreateObject("Scripting.FileSystemObject")
If MyFSO.FileExists("C:\temp\text.txt") Then
MsgBox "The File Exists"
Else
MsgBox "The File Does Not Exist"
End If
End Sub
but perhaps easier:
Code:
Sub CheckFileExist2()
If Dir("C:\temp\text.txt") = "" Then
MsgBox "The File Does Not Exist"
Else
MsgBox "The File Does Exist"
End If
End Sub