S
Sarah B via OfficeKB.com
Background:
I have been learning to use error handling when coding macros - mostly just
using On Error GoTo statements. I have a subroutine that is called from an
OnError GoTo block. If a certain condition is met (no files were found that
fit my criteria), I want my subroutine to throw an error and return to the
function that called it. This is not a situation that will normally throw an
error, but I need to handle it as if it were an error.
Question:
How do I throw an error? (short of simply putting in a non-valid statement
that I know will cause a real error)
I have been learning to use error handling when coding macros - mostly just
using On Error GoTo statements. I have a subroutine that is called from an
OnError GoTo block. If a certain condition is met (no files were found that
fit my criteria), I want my subroutine to throw an error and return to the
function that called it. This is not a situation that will normally throw an
error, but I need to handle it as if it were an error.
Question:
How do I throw an error? (short of simply putting in a non-valid statement
that I know will cause a real error)