Protect Method Properties

GRCArizona

Board Regular
Joined
Apr 24, 2010
Messages
95
Hi All -

I'm a little confused by what is happening when I use the 'Protect' method in my "Worksheet_Open" event. I have the following code and what I'm trying to accomplish is allow the end-user to Edit Scenarios and Drawing Objects. After running this code, I go and check the Protect properties on several worksheets (IE: select a worksheet, unprotect the worksheet and then re-protect it), I notice the 'Edit Objects' and 'Edit Scenarios' are NOT checked. I would think that by setting the variable to :=False, that I would see a check mark next to both of these properties. BTW, all the others are checked - except 'Select locked cells' (which is what I want). Any ideas on what I'm doing wrong?

Dim wks As Worksheet
For Each wks In ThisWorkbook.Worksheets
wks.EnableOutlining = True
wks.EnableSelection = xlUnlockedCells
wks.Protect Password:="Hide_Your_Kids", DrawingObjects:=False, Contents:=True, Scenarios:= _
False, UserInterfaceonly:=True, AllowFormattingCells:=True, AllowFormattingColumns:=True, _
AllowFormattingRows:=True, AllowInsertingColumns:=True, AllowInsertingRows _
:=True, AllowInsertingHyperlinks:=True, AllowDeletingColumns:=True, _
AllowDeletingRows:=True, AllowSorting:=True, AllowFiltering:=True, _
AllowUsingPivotTables:=True
Next wks
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)

Forum statistics

Threads
1,223,236
Messages
6,170,912
Members
452,366
Latest member
TePunaBloke

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top