prevent user from deleting a tab prevent running macro from menu

  • Thread starter Thread starter joemeshuggah
  • Start date Start date
J

joemeshuggah

how can one prevent a user from

1. deleting a specific tab in a workbook?

2. prevent a user from running a macro from the tools menu (where user can
only run a macro from a command button)?

thanks!
 
#1.

Protect the workbook's structure.

In xl2003 menus:
tools|protection|protect workbook|check structure

#2.

Make the sub private:

Sub Testme()
becomes
Private Sub testme()

This will stop the user from seeing that subroutine--but if they know the name,
they can still type it and run it.
 
1. deleting a specific tab in a workbook? PROTECT the workbook.

2. prevent a user from running a macro from the tools menu (where user can
only run a macro from a command button)? Maybe you could tweak the macro
to ensure it's being run on the correct worksheet. To prevent it from the
tools menu can be a bit complicated.
 
solution 2 works great...thanks!

solution 1 though i am still not sure on. i have a macro in the workbook
that adds sheets. i added made the structure protection false before the
macro adds the sheets, and then true after the sheets are added. however,
the user needs to have the ability to delete or rename the sheets that were
added in the macro. is there a way around this?
 
Give them a macro or several macros that do exactly what you want. Otherwise,
you'll find that sheets you don't deleted will be gone.
 
thanks again!

i believe i was able to get around it by having the new sheets created in a
new workbook.
 
Back
Top