Protect Method Properties

GRCArizona

Board Regular
Joined
Apr 24, 2010
Messages
93
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

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,168,082
Messages
5,857,251
Members
431,866
Latest member
Paula777

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
Top