hi all
I've created a code that check if the file exist or not but i've get error mesage when
no file allthough i've made error msgbox
pls see where is the mistake:
Code
Private Sub CommandButton1_Click()
'Dim Filename
Filename = "Test" & TextBox1.Value
ChDrive "E"
ChDir "E:\Intag"
If Dir("E:\Intag\") & Filename <> "" Then
Workbooks.Open Filename:=Filename
Unload Me
Else
MsgBox "There is no file with this name", vbInformation
TextBox1.Value = ""
End If
End Sub
Display More