怎样编写如果文件格式异常提示异常的代码

怎样编写如果文件格式错误提示错误的代码

如图,我要选择.xsl格式文件,如果不是应该提示文件格式不正确,要怎么该以下代码
Private Sub Dir1_Change()
  File1.Pattern = ("*.xls")
  File1.Path = Dir1.Path
End Sub
Private Sub Drive1_Change()
  Dir1.Path = Drive1.Drive
End Sub

Private Sub File1_Click()
  Text1.Text = "" & Dir1.List(-1) & "\" & File1.FileName
End Sub

------解决方案--------------------
Text1.Text = "" & Dir1.List(-1) & "\" & File1.FileName
=>
if not File1.FileName Like "*.xls" then
MsgBox "不正确"
else
Text1.Text = "" & Dir1.List(-1) & "\" & File1.FileName
end if