Worksheet.Protect AllowFormattingCells

bsquad

Board Regular
Joined
Mar 15, 2016
Messages
194
I am running into some issues between Excel 2010 and Excel 2013; if I have on Excel 2013 and open and run it in Excel 2010

Code:
worksheet.protect Password:="pw", UserInterfaceOnly:=True

I run into no issues

but if I have


Code:
worksheet.protect Password:="pw", UserInterfaceOnly:=True, AllowFormattingColumns:=True, AllowFormattingRows:=True, AllowFormattingCells:=True

I run into crashing and freezing issues on 2010, did 2010 have these parameters or am I missing a Reference library? I know I've had Reference library issues in the past with backwards compatibility, but can't seem to find 2010 parameter list for worksheet.protect
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
All the arguments in the latter line of code you posted are valid in XL2010. Are you certain this is the line that causes the problem?
 
Upvote 0
thanks for the response; yes I am certain it is what is causing the issue, it could obviously be in conjunction with parts of other code on it. Although I should note; running the Worksheet.protect doesn't actually cause it to crash; its when I run the other part of the code on it where I basically have a spc copy paste(Formats, ColumnWidths and Values) from another workbook. I unfortunately can't really paste the code because its gigantic - but each time I use only UserInterfaceOnly, it doesn't crash
 
Upvote 0

Forum statistics

Threads
1,224,824
Messages
6,181,186
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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