XL2000: EnableSelection Property May Be Overridden (213242)
The information in this article applies to:
This article was previously published under Q213242 SYMPTOMS
In Microsoft Excel, when you use the Microsoft Visual Basic EnableSelection property to restrict certain cells in a worksheet from being selected, you may still be able to select the restricted cells. For example, if you use the following code in a macro to prevent selection of locked cells
Sub Test()
With ActiveSheet
.EnableSelection = xlUnlockedCells
.Protect Contents:=True, UserInterfaceOnly:=True
End With
End Sub
it may still be possible to select locked cells.
CAUSE
This occurs because the EnableSelection property does not always prevent you from selecting cells by using the Name box on the formula bar.
Also, you can use a macro to select cells, even if they are locked, by
using a line of code similar to the following:
Range("B5").Select
RESOLUTION
Even though you can select restricted cells, if the cells are locked and
the worksheet is protected, you cannot change them.
STATUSMicrosoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.
Modification Type: | Minor | Last Reviewed: | 10/11/2006 |
---|
Keywords: | kbbug kbpending kbProgramming KB213242 |
---|
|