Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Below is my code. It worked fine until today and I didn't change
anything. I currently have this code in an .xla add-in, but the menu that should be appearing on the Worksheet Menu Bar does not work. When I try to run the code manually, I get the error Method 'OnAction' of object '_CommandBarButton' failed on the .Controls(MenuName).OnAction = "Conversion" line Thanks for any help. Sub Auto_Open() Dim cWmb As String, cMm As String Dim MenuName As String cWmb = "Worksheet Menu Bar" cMm = "Utilities" Application.ScreenUpdating = False 'To delete any existing Utilities menus On Error Resume Next CommandBars(cWmb).Controls(cMm).Delete On Error GoTo 0 'Add menu CommandBars(cWmb).Controls.Add(Type:=msoControlPop up, Befo=CommandBars(cWmb).Controls.Count - 1).Caption = cMm 'Use the menu to create the menu item(s) With CommandBars(cWmb).Controls(cMm) MenuName = "&Conversion" .Controls.Add(Type:=msoControlButton).Caption = MenuName .Controls(MenuName).OnAction = "Conversion" End With Application.ScreenUpdating = True End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
creating my own menu item in excel | Excel Discussion (Misc queries) | |||
Creating sub menu in Command bar | Excel Programming | |||
Creating sub menu in Command bar | 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 |