![]() |
Context sensitive menu options
The following code adds another paste special option to the right click menu With Application.CommandBars("Cell").Controls _ .Add(Type:=msoControlButton, befo=5, _ Temporary:=False) .Caption = "Paste &Value" ' .OnAction = "PasteSpecValue" .Tag = "PS_PasteValue" .Enabled = True End With Is there a code action to enable or disable that option dynamically as the clipboard status alternates between filled and empty rather than test in the 'onaction' procedure at a lower level ? TIA -- Ken "Started using Visicalc in 82" |
Context sensitive menu options
You can use the SheetBeforeRightClick event to check whether the clipboard object is empty or not. If empty disable the option as below.. Private Sub Workbook_SheetBeforeRightClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean) If <object is nothing then Application.CommandBars("cell").Controls("controln ame").Enabled = False End If End Sub If this post helps click Yes --------------- Jacob Skaria "K_Macd" wrote: The following code adds another paste special option to the right click menu With Application.CommandBars("Cell").Controls _ .Add(Type:=msoControlButton, befo=5, _ Temporary:=False) .Caption = "Paste &Value" ' .OnAction = "PasteSpecValue" .Tag = "PS_PasteValue" .Enabled = True End With Is there a code action to enable or disable that option dynamically as the clipboard status alternates between filled and empty rather than test in the 'onaction' procedure at a lower level ? TIA -- Ken "Started using Visicalc in 82" |
All times are GMT +1. The time now is 08:13 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com