on error goto 0
on error resume next on error goto 0 is in effect, a runtime error causes the application to terminate and print an error message. This is the default behaviour. on error resume next does not stop a program when a runtime error occurs. In order to detect errors, the err object needs to be queried after each statement that is supsected to cause a runtime error.