ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How can I make macros execute on a protected sheet? (https://www.excelbanter.com/excel-programming/335545-how-can-i-make-macros-execute-protected-sheet.html)

J Scott

How can I make macros execute on a protected sheet?
 
I have several command buttons attached to macros to enlarge or reduce the
size of embedded charts. When I protect the sheet, the macros will not
execute. Is there a way to protect the sheet and still enable the macros?

jgeniti

How can I make macros execute on a protected sheet?
 
In your macro you could just add a line of code at the begining to
unprotect the sheet and then at the end of the code you can protect the
sheet again.

activesheet.unprotect
- macro code
activesheet.protect

if you have the sheet passwork protected you will need to add the
password at the end

activesheet.unprotect "password"


philcud

How can I make macros execute on a protected sheet?
 
ActiveSheet.Unprotect Password:="XXX"



All times are GMT +1. The time now is 11:46 AM.

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