ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   prevent user from deleting a tab prevent running macro from menu (https://www.excelbanter.com/excel-programming/439984-prevent-user-deleting-tab-prevent-running-macro-menu.html)

joemeshuggah

prevent user from deleting a tab prevent running macro from menu
 
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!

Dave Peterson

prevent user from deleting a tab prevent running macro from menu
 
#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.




joemeshuggah wrote:

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!


--

Dave Peterson

Barb Reinhardt

prevent user from deleting a tab prevent running macro from menu
 
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.
--
HTH,

Barb Reinhardt



"joemeshuggah" wrote:

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!


joemeshuggah

prevent user from deleting a tab prevent running macro from me
 
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?

"Dave Peterson" wrote:

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




joemeshuggah wrote:

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!


--

Dave Peterson
.


Dave Peterson

prevent user from deleting a tab prevent running macro from me
 
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.

joemeshuggah wrote:

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?

"Dave Peterson" wrote:

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




joemeshuggah wrote:

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!


--

Dave Peterson
.


--

Dave Peterson

joemeshuggah

prevent user from deleting a tab prevent running macro from me
 
thanks again!

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

"Dave Peterson" wrote:

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.

joemeshuggah wrote:

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?

"Dave Peterson" wrote:

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




joemeshuggah wrote:

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!

--

Dave Peterson
.


--

Dave Peterson
.



All times are GMT +1. The time now is 05:47 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com