PopUpMenu in Flexgrid - Excel2002
Hello,
I'd like to know if it's possible to get a PopUpMenu with Flexgrid when using Excel 2002 ? Regards, Nader |
PopUpMenu in Flexgrid - Excel2002
Hi,
you can use a regular popup (like when right-clicking a cell) on a userform. 3 steps: - In initialize of the Userform: create the new popup commandbar - hidden. Call CreateMyPopup. - In Tereminate: delete it. Call DeleteMyPopup. - when clicking; doubleClick; or Right-Click a control, show the popup. Call PopupMyPopup. ''' ---------------------------------------------------------- Sub CreatePopupBar() Dim c As CommandBar Dim cbb As CommandBarButton ''' get/create popup bar On Error Resume Next Set c = Application.CommandBars("MyPopup") If Err < 0 Then Set c = Application.CommandBars.Add(Name:="MyPopup", Position:=msoBarPopup, temporary:=True) End If On Error GoTo 0 ''' add controls Set cbb = c.Controls.Add(msoControlButton) cbb.Caption = "submenu1" Set cbb = c.Controls.Add(msoControlButton) cbb.Caption = "submenu2" End Sub Sub DeletePopupBar() On Error Resume Next Application.CommandBars("MyPopup").Delete On Error GoTo 0 End Sub Sub PopupMyPopup() Dim c As CommandBar Set c = Application.CommandBars("MyPopup") c.ShowPopup End Sub '''----------------------------------------------------------- -- Regards, Sébastien <http://www.ondemandanalysis.com "Nader" wrote: Hello, I'd like to know if it's possible to get a PopUpMenu with Flexgrid when using Excel 2002 ? Regards, Nader |
All times are GMT +1. The time now is 09:15 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com