Protect sheets: The EnableSelection property is not saved + Excel update fixDate: October 24, 2007
reference id: QA0162
(this article was previously published on our weblog)
Recently I got the following question: "When using the “protect multiple sheets at once” and checking only the “select unlocked cells” checkbox I find that once I save and reopen the sheets now behave as if both the “select unlocked cells” as well as the “select locked cells” seems to be in effect as I can then select any cell, however, the rest of the protections seem to be in place."
At first I couldn't reproduce the problem, however when I did it on a computer with Excel 2003 without any service packs installed I could replicate the problem. At first it looks just right but when you save, close and re-open the file the setting of selecting only unlocked cells was lost. I found in the MS Knowledge base that this is a bug that is fortunately fixed in one of the Excel service packs. After I installed the service pack the utility worked as expected.
Microsoft has confirmed that this is a problem in Excel 2002 and 2003: KB918323
When you try to use a Microsoft Visual Basic for Applications (VBA) macro to set the EnableSelection property in Microsoft Excel 2002 or in Microsoft Office Excel 2003, the EnableSelection property is not saved. After the workbook is saved, closed, and then opened, cells that you expect to be locked can be selected.
If you set the EnableSelection property manually, the changes are saved. Additionally, locked cells cannot be selected when the workbook is opened.
More information about this Excel bug in Excel 2002/XP and 2003:
Excel 2002 post-Service Pack 3 hotfix package: May 6, 2004
Description of the Excel 2003 post-Service Pack 1 hotfix package: August 20, 2004
To download the service pack from Office Update, visit the following Microsoft Web site:
Unfortunately this bug also exists in Excel 2007 (12.0.4518 and 12.0.6024) and I haven't seen a fix for this. I also found out that if you save the file as an Excel 97-2003 workbook, the selection restrictions will be saved. However if you save the file in 2007 format the setting is lost. Protecting one sheet at a time manually works. However doing it with a macro still has issues in Excel 2007...
Follow ASAP Utilities on Facebook
List of all utilities
Printer friendly page
^ Back to Top