I have created a file association for my program. So if the user goes to the name of the file they saved using my program and open up the file from the run browse etc. my program will open and show the saved information. Now some times I receive this message when I open a file and sometimes I dont it will just open my program and show the saved work. This problem does not happen when I open my program directly using the exe, only when I open a file that is associated with my app. This is the error that I receive sometimes.

Run-time error '53':
File not found

Now if I try to open the file again it opens with no problem.

This is the code I am using in the form load declaration so that a user can open the saved information by opening a file that they saved with my program

VB Code:
  1. If Len(Command$) > 0 Then
  2.   lblfilename.Caption = Command$
  3.   sfilename = Command$
  4.   cdbexpenditures.FileName = Command$
  5.  
  6.  
  7.   Open sfilename For Input As #1
  8.   Do While Not EOF(1)
  9.     Line Input #1, sfilename
  10.     strlistdata = Split(sfilename, "::")
  11.     list1.AddItem strlistdata(0)
  12.     List2.AddItem strlistdata(1)
  13.     List3.AddItem strlistdata(2)
  14.   Loop
  15.   Close #1

Can someone help me tell me how to stop this error message if anyone needs to see the app I can provide the exe and tell them what to do so they can see what the problem is