Vb On Error Resume Next. On Error Resume Next simply swallows errors. Being a vb.noob as basically most of the vb.net world, I use the Try/Catch statement quite a bit for when it comes to errors, as the following.
You need to figure out how to avoid the error to begin with. I generally try to avoid On Error Resume Next as it will try to continue no matter what the error (there are some cases where it's useful though). Number to detect if an error has occurred (Remember to use Err.
EDIT: Richard, I think your code will not detect a missing workbook if the wb variable was.
Or is that just the way it works?
NOTE: On Error Resume Next statement doesn't fix the runtime errors, it's an error ignoring where VB program execution will continue from the line Before the explanation of On Error Resume Next, you should be aware of runtime error when impossible mathematical statements or terms present in a. Application Set Outlook = New Outlook. On Error resume next - Enable error handling.