Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Drop dwn menu. Formula to count selection frm menu in anoth cell? | Excel Worksheet Functions | |||
Excel -My paste menu is not the norm. The menu is different. | Setting up and Configuration of Excel | |||
filter dropdown menu so 2nd drop menu is customized | Excel Worksheet Functions | |||
Create Dropdown menu without using the Validation on the Data Menu | Excel Worksheet Functions | |||
Menu items added with menu item editor in older versions | Excel Discussion (Misc queries) |