Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This is a big one, it's become extremely vital. Over last 3 weeks I have
done a lot of work writing up several workbooks that contain numerous buttons with macros assigned to them. One false step or accidental delete and those buttons are gone! But when I protect the sheet, all the buttons return error codes. Can someone pls direct me to a webpage tutorial that explains how to protect sheets so that the buttons will still work? I understand how to lock cells and such, that I've been doing for years, it's protecting the sheet as per normal but allowing the buttons full functionality. Thank you! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
do you mean that when you press the button it returns an error as you're trying to do something you can't do when the sheet is protected? if so how about incorporating in your macros the unprotecting of the sheet at the start & the reprotecting of the sheet at the end of the macro? Cheers JulieD "StargateFanFromWork" wrote in message ... This is a big one, it's become extremely vital. Over last 3 weeks I have done a lot of work writing up several workbooks that contain numerous buttons with macros assigned to them. One false step or accidental delete and those buttons are gone! But when I protect the sheet, all the buttons return error codes. Can someone pls direct me to a webpage tutorial that explains how to protect sheets so that the buttons will still work? I understand how to lock cells and such, that I've been doing for years, it's protecting the sheet as per normal but allowing the buttons full functionality. Thank you! |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
What are the error codes? Protecting a sheet shouldn't affect the execution
of a macro It may be as simple as the buttons attempting to alter the value of a protected cell. Regards, "StargateFanFromWork" wrote in message ... This is a big one, it's become extremely vital. Over last 3 weeks I have done a lot of work writing up several workbooks that contain numerous buttons with macros assigned to them. One false step or accidental delete and those buttons are gone! But when I protect the sheet, all the buttons return error codes. Can someone pls direct me to a webpage tutorial that explains how to protect sheets so that the buttons will still work? I understand how to lock cells and such, that I've been doing for years, it's protecting the sheet as per normal but allowing the buttons full functionality. Thank you! |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sorry, hit Send prematurely!
Try wrapping your code in Sheets("Sheet1").Unprotect ("YourPassword") Your Code Sheets("Sheet1").Protect ("YourPassword") Regards, "StargateFanFromWork" wrote in message ... This is a big one, it's become extremely vital. Over last 3 weeks I have done a lot of work writing up several workbooks that contain numerous buttons with macros assigned to them. One false step or accidental delete and those buttons are gone! But when I protect the sheet, all the buttons return error codes. Can someone pls direct me to a webpage tutorial that explains how to protect sheets so that the buttons will still work? I understand how to lock cells and such, that I've been doing for years, it's protecting the sheet as per normal but allowing the buttons full functionality. Thank you! |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Wed, 30 Jun 2004 10:38:24 -0400, "StargateFanFromWork"
wrote: This is a big one, it's become extremely vital. Over last 3 weeks I have done a lot of work writing up several workbooks that contain numerous buttons with macros assigned to them. One false step or accidental delete and those buttons are gone! But when I protect the sheet, all the buttons return error codes. Can someone pls direct me to a webpage tutorial that explains how to protect sheets so that the buttons will still work? I understand how to lock cells and such, that I've been doing for years, it's protecting the sheet as per normal but allowing the buttons full functionality. Thank you! Thank you so much to Dave Peterson who gave code that worked great in my test file here at home. Here is the syntax, the only thing that needs modifying is the macro name and the code one puts in that the macro deals with, of course <g: Sub MacroName() ' With ActiveSheet .Unprotect (code goes here) End With End Sub The above allowed me to apply _one_ unprotect/protect lines of code to the macros regardless of sheet names. So in this test file, where I had 10 sheets, 2 macros did the job! If I had not had a generic type of code - in other examples where the sheet name had to be entered, in other words - 20 different macros would have been required! Not a pleasant prospect. Thank you so much to Dave for this! This was the last major hurdle <crossing fingers to fix on all the workbooks. The remaining two weeks will allow me to test the files fully as I continue doing my job which requires using these files on a daily basis. Cheers! |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Sat, 03 Jul 2004 00:13:23 -0400, StargateFan
wrote: On Wed, 30 Jun 2004 10:38:24 -0400, "StargateFanFromWork" wrote: [snip] Sub MacroName() ' With ActiveSheet .Unprotect (code goes here) End With End Sub WOOPS, missing line. The code above s/b: Sub MacroName() ' ' With ActiveSheet .Unprotect (code goes here) .Protect End With End Sub Sorry about that! I accidentally deleted the ".Protect" line when modifying existing code to get the above to share with the group. Glad I noticed it, though. <g |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
protecting all but command buttons | Excel Discussion (Misc queries) | |||
Protecting My Macros | Excel Worksheet Functions | |||
Protecting Macros -is it possible | Excel Programming | |||
Macros assigned to buttons do not work when copied to CD | Excel Programming |