Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Gang,
I have a weird situation I can't get my head around. I have created a macro that call a calendar control to make it easier to add dates into my spreadsheet. I also added the functionality to the right click context menu with the following code (added to Personal.xls): Private Sub Workbook_Open() Dim NewControl As CommandBarControl Application.OnKey "+^{C}", "ThisWorkbook.OpenCalendar" Set NewControl = Application.CommandBars("Cell").Controls.Add With NewControl .Caption = "Insert Date" .OnAction = "Module1.OpenCalendar" .BeginGroup = True End With End Sub It works fine, but every time I closed and re-open the worksheet a new Insert data item is added to the menu (I currently have 14). I tried adding: Private Sub Workbook_BeforeClose(Cancel As Boolean) Set NewControl = Nothing End Sub but this did not seem to work either. Any suggestions would be much appreciated. Steve |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
can i avoid repeating rows when adding calculated item in pivot ta | Excel Worksheet Functions | |||
Add menu item to right-click menu | Excel Programming | |||
Adding Sub Menu Item to Current Custom Menu | Excel Programming | |||
Menu items added with menu item editor in older versions | Excel Discussion (Misc queries) | |||
Adding a menu item right click menu when clicking on a single. | Excel Programming |