Well....
Being new to code..... I am exploring custom menu play and was attempting to use a small routine I found here to add custom menus to cell right click. The code:
Sub SetUpBar()
With Application.CommandBars("Cell")
Set temp = .Controls.Add(msoControlButton)
temp.Caption = "Test1"
temp.OnAction = "Routine1" 'put routine1 in regular module
Set temp = .Controls.Add(msoControlButton)
temp.Caption = "Test2"
temp.OnAction = "Routine2" 'put routine2 in regular module
End With
End Sub
Works extremely well! and.... Since it was set as temp I guess I thought I didn't need to remove this custom work upon close.
Can anyone help with a routine to Delete the custom popup buttons I have managed to add with this code?
any help would be appreciated.
mweaver
Being new to code..... I am exploring custom menu play and was attempting to use a small routine I found here to add custom menus to cell right click. The code:
Sub SetUpBar()
With Application.CommandBars("Cell")
Set temp = .Controls.Add(msoControlButton)
temp.Caption = "Test1"
temp.OnAction = "Routine1" 'put routine1 in regular module
Set temp = .Controls.Add(msoControlButton)
temp.Caption = "Test2"
temp.OnAction = "Routine2" 'put routine2 in regular module
End With
End Sub
Works extremely well! and.... Since it was set as temp I guess I thought I didn't need to remove this custom work upon close.
Can anyone help with a routine to Delete the custom popup buttons I have managed to add with this code?
any help would be appreciated.
mweaver