Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default 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"
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default 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"

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Context-Sensitive Help Risky Dave Excel Programming 2 March 10th 09 03:28 PM
Context-sensitive custom menu item. Murray Excel Programming 7 December 28th 05 04:55 AM
Context sensitive help Jon Bailes Excel Programming 2 January 14th 05 01:19 PM
Context sensitive menu Mark[_36_] Excel Programming 5 March 3rd 04 01:50 PM
context sensitive help Malcolm Excel Programming 0 November 19th 03 02:00 PM


All times are GMT +1. The time now is 11:47 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"