Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have this as the first lines of code under an open workbook in it's:
This Workbook Apps Private Sub App_SheetBeforeRightClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean) ---code--- If ActiveSheet.ProtectContents = True And ActiveCell.Locked = True Then With Application.CommandBars("Cell").Controls .Item(2).Enabled = False End With Else With Application.CommandBars("Cell").Controls .Item(2).Enabled = True End With End If It always will return True no matter if the workbook is protected or not. But if I use the code above on a right click menu custom item after the item is clicked then it correctly identifies if the sheet is protected or not. What am I doing wrong here? Thank you for your help. Steven |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to change syperlink from single click to double click | Excel Worksheet Functions | |||
Disabling click and right-click on the Picture I inserted in an Excel document | Excel Worksheet Functions | |||
userform label double-click goes to click event | Excel Programming | |||
Click on graph bar to execute a double-click in a pivot table cell | Charts and Charting in Excel | |||
Mouse Over Graph, Capture Information on Click(Double Click) | Excel Programming |