prevent user from deleting a tab prevent running macro from menu

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!
 
D

Dave Peterson

#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.
 
B

Barb Reinhardt

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.
 
J

joemeshuggah

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?
 
D

Dave Peterson

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.
 
J

joemeshuggah

thanks again!

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

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