LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default pop up menu

I want to raise a custom pop up menu when I right click in
a user form text box . I have the code that tells me which
mouse button was pressed when in the TB so all I need is
the code for the pop up.
I have tried the following from the VBA help files......

Set copyAndPasteMenu = CommandBars.Add( _
Name:="Custom", Position:=msoBarPopup, _
Temporary:=True)
Set copy = copyAndPasteMenu.Controls.Add
With copy
.FaceId = CommandBars("Standard").Controls("Copy").Id
.Caption = "Copy the selection"
End With
Set paste = copyAndPasteMenu.Controls.Add
With paste
.FaceId = CommandBars("Standard").Controls("Paste").Id
.Caption = "Paste from the Clipboard"
End With
copyAndPasteMenu.ShowPopup 200, 200

.......which works fine and would do what I want, but it
only ever runs once. If I try running it a second time I
get an error associated with first line of code. If I
close the application and Excel then restart all, it works
again, but just the once.
I notice it has no provision to delete the named
command bars it might have previously created . Could this
be the problem??
Any help from those wiser than I would be greatly
appreciated.
Don Bowyer
 
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
Drop dwn menu. Formula to count selection frm menu in anoth cell? ggoldber Excel Worksheet Functions 1 June 4th 08 02:21 PM
Excel -My paste menu is not the norm. The menu is different. wduval1715 Setting up and Configuration of Excel 2 November 3rd 07 07:07 PM
filter dropdown menu so 2nd drop menu is customized menugal Excel Worksheet Functions 1 September 4th 07 05:25 PM
Create Dropdown menu without using the Validation on the Data Menu lostinformulas Excel Worksheet Functions 0 July 13th 06 08:47 PM
Menu items added with menu item editor in older versions Michael Hoffmann Excel Discussion (Misc queries) 2 January 7th 05 01:40 PM


All times are GMT +1. The time now is 09:36 PM.

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"