It looks like the old code used On Error Resume Next. Make sure you understand what he is doing, kinda weird!
docs explain it
In the "Error at restart" window that appears, execution will continue to execute the instruction immediately after the statement that caused the runtime error, or with the statement immediately after the most recent call to the procedure containing the "Force resume next" statement. This statement allows you to continue execution, despite a runtime error. You can place the error handling procedure where the error will occur, and not transfer control to another place inside the procedure.
Then you should use If Err.Number <> 0 to check if an error has occurred.
Markj source share