R
Ron de Bruin
A little teamwork
I love this group
I love this group
This is a normal behavior for a item on the menu bar.
Normally you always use Sub menu's under a item on the Menu bar.
Use a sub menu which call the macro to avoid this
A minor modification to Ron's routine:
On Error GoTo 0
You are right that it is a bit taller.
But why is that a problem for you?
You can see why it's bad practice by running try1:
if you never check errors, probably none.
If you use error checking in your routines, like
'Do something
If Err <> 0 Then
'Do something else
then not clearing your flags may give cause you to perform the error
handling routine unnecessarily.
In small, self-contained environments, not including On Error GoTo 0
probably won't get you into trouble.
Where it's important is in situations where you re-use code (i.e., it
may not be important this time, but future code may fail) or where you
may add code to the Sub that will fail if the On Error Resume Next is
still set. If nothing else, it's a visual cue, when I go to add code,
that my environment is not the default.
FWIW, while this is my opinion only, it also reflects a certain
discipline in one's approach to programming. I trust code that resets
properties even if it's not required in *this* particular situation,
much more than code that appears to take shortcuts. To me it indicates
a habit of thoroughness, as well as courtesy to those who have to
maintain the code.
Hi David
You are right that it is a bit taller.
But why is that a problem for you?
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.