in a module i have this:

VB Code:
  1. Public Function File_Exists(strFilePath As String)
  2.     If Dir(strFilePath, vbNormal + vbHidden + vbSystem + vbReadOnly) = "" Then
  3.         File_Exists = False
  4.     Else
  5.         File_Exists = True
  6.     End If
  7. End Function
  8.  
  9. Public Function ShellOpenFile(filepath As String)
  10.     If (File_Exists(filepath)) Then
  11.         Shell "notepad filepath", vbNormalFocus
  12.     Else
  13.         MsgBox "No such file: " & filepath
  14.     End If
  15. End Function

in my form1, i have this..

VB Code:
  1. Private Sub Command2_Click()
  2.     ShellOpenFile ("C:\test.txt")
  3. End Sub

but it keeps saying that 'filename.txt' doesnt exist