Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If i protect a worksheet the macro is not executing. it is giving error
message as Run-Time Error 1004 You cannot use this command in a protected sheet. kindly suggest the procedure to execute the macro in a protected sheet. i want to protect some cells in the sheet from being uptaion. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
you'll need to uprotect the sheet at the start of the macro and protect it again at the end e.g. sub mymacro() activesheet.unprotect ("pwd") 'current code activesheet.protect ("pwd") end sub where pwd is your password Cheers JulieD "das.s.k" wrote in message ... If i protect a worksheet the macro is not executing. it is giving error message as Run-Time Error 1004 You cannot use this command in a protected sheet. kindly suggest the procedure to execute the macro in a protected sheet. i want to protect some cells in the sheet from being uptaion. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If you are protecting the worksheet from the VBA code you
might try this: Dim x as Boolean x = Worhsheets(1).Protect_ (DrawingObjects:=True, Contents:=True, _ Scenarios:=True, UserInterfaceOnly:=True) The last arg sets the protection so that a macro can alter the sheet but a user cannot. Hope this helps Tony -----Original Message----- If i protect a worksheet the macro is not executing. it is giving error message as Run-Time Error 1004 You cannot use this command in a protected sheet. kindly suggest the procedure to execute the macro in a protected sheet. i want to protect some cells in the sheet from being uptaion. . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro & Protected sheet | Excel Discussion (Misc queries) | |||
use macro button to run macro in protected sheet | Excel Discussion (Misc queries) | |||
Macro Errs when sheet is protected | Excel Worksheet Functions | |||
excel - macro code to open a protected sheet, enter passowrd, and then protect sheet | Excel Programming | |||
Using a Macro with the sheet protected. | Excel Programming |