ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Locking buttons on sheet (https://www.excelbanter.com/excel-programming/352026-locking-buttons-sheet.html)

AMK4[_28_]

Locking buttons on sheet
 

I have something odd going on here. I have a sheet that has a button o
it to which I've assigned a macro. The button's properties are set t
Locked and Lock Text.

Upon opening the worksheet containing this sheet, I have the followin
snippet run
Code
-------------------
wSheet.Protect Password:="cookies2006", Contents:=True, UserInterfaceOnly:=True, AllowFormattingColumns:=True
wSheet.Visible = xlSheetVisible
wSheet.Activate
wSheet.Range("D4").Selec
-------------------


When that runs, it locks everything just fine ... except the button.
can right click on it and assign a different macro, as if nothin
happened.

Now, if I manually unlock the sheet, and manually re-lock it, suddenl
the button is locked and I can no longer change the macro (which i
what I want to do in the first place.) However, by doing it manually
I loose the UserInterfaceOnly attribute. And this needs to be don
automatically anyway, not manually.

Is there something I'm missing

--
AMK
-----------------------------------------------------------------------
AMK4's Profile: http://www.excelforum.com/member.php...fo&userid=1914
View this thread: http://www.excelforum.com/showthread.php?threadid=50712



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

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