Be seen. Boost your question’s priority for more expert views and faster solutions
Function DoSomethingWithFile()
' Error trapping
On Error Goto catch
' ---
' File-handling code
' ---
Exit Function ' To avoid error message during normal execution
catch:
Print "Error in Function ""DoSomethingWithFile"": " & Str(Err) & " " & Error$ & " on row " & Cstr(Erl)
Exit Function
End Function
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
If the user is supposed to read a file, consequently try that. If he/she needs to write a file, give that a try. If you're unfamiliar with that, check designer help on "Open".
Do all that in a separate function with built-in error trapping (on error goto..). Return e.g. true if all went well, or false when not.