Not a problem. I anticipated that so I used:
On Error Resume Next
which just swallows any errors.
You see, I'm completely opposed to ever using On Error Resume next
to eat a single anticipated error, since you never know if some
*unanticipated* error might also get eaten.
And I would certainly *never* put it at the top of a sub/function,
since I am convinced from experience that On Error Resume Next
properly respects scope. That is, I've seen places where it appears
that such a statement without a corresponding On Error GoTo 0 to
cancel it appears to stay in effect outside the expected scope. This
is one of the reasons I'm so cautious with using it.
If you know a particular error is going to happen and you want to
ignore it, then trap for that error and throw it away.
Anything else is incredibly bad coding practice, in my opinion.
But then, that also reflects my error trapping philosophy, that you
never construct your error handling such that it will ever possibly
hide useful error conditions.