Protecting buttons with VB code rather than protecting sheets/books?

  • Thread starter StargateFanFromWork
  • Start date
S

StargateFanFromWork

I ran into endless troubles protecting sheets, as some know (also, as I now
feel sure must be a common problem already commonly known).

When the sheets were protected, many of the functions of the buttons as well
as required general functions would no longer work. We got around a few of
the restrictions by having unprotect/protect sheet coding at beginning and
end of the macros, but that was a tricky and time-consuming workaround to
the problem which still didn't allow simple things like inserting rows,
etc., to be done. Again, a lot of time and complex coding would have gotten
around that, possibly, but not in the time I had available. So, I've left
the sheets "live", as it were. All of them!

But I've been mulling things over in my mind.

The greatest problem that might not be as easily overcome as other erasures
in these sheets, really, is accidental erasure of those buttons. Granted I
put copies with the attached macros elsewhere in the sheet, out of sight yet
easily accessible. I had originally planned to put them on a hidden sheet
but have too many hidden sheets for data validation purposes so putting them
out of the print area seems a good alternative. Anyway, I got to thinking,
is there a way to "protect" the buttons themselves just from being erased
and perhaps even moved using some sort of VB code? Something that would not
interfere with their function, just would protect them from being eradicated
<g>.

I know I'm fishing with this one <g>, but this doesn't seem like an
impossibly overly-ambitious thing <g>(?).

Thanks.
 
D

David

StargateFanFromWork wrote
is there a way to "protect" the buttons themselves just from being
erased and perhaps even moved using some sort of VB code? Something
that would not interfere with their function, just would protect them
from being eradicated

I thought that's what Tools | Protection | Sheet checking only Objects was
for.
 
S

StargateFanFromWork

David said:
StargateFanFromWork wrote


I thought that's what Tools | Protection | Sheet checking only Objects was
for.

BLESS YOU!!! I'd like to borrow a phrase from a friend, though I hope it
won't embarrass you: I could kiss you on all 4 cheeks! <lol>

I asked more than once in 2 Excel groups and tried so many different
combinations. Yet I guess I must have somehow missed JUST objects. And
_no_one_ knew about this OBJECTS option, obviously, or they would have said.

IT WORKS!!!

Today is my last day so your advice came in the nick of time! Unbelievably
close to the wire! <g> I'll be leaving this position totally reassured that
the doct will stay fairly intact. Oh, they can still screw things up, but
at least they won't accidentally delete the buttons <g>.

THANK YOU!! :blush:D
 

Ask a Question

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.

Ask a Question

Top