My team created Excel Add-in toolbars to open our Excel macro tools. The custom functions in these Add-in are no longer displaying (or accessible) on the Excel 'right-click' menu.
We use Windows 10 / 64-bit MS Office 365/2016.
Were these UDFs disabled by Microsoft?
I have no way to know if these are disabled by the security of our company.
Public Sub AddItemToCellMenu()
'Application.CommandBars("Cell").Reset
Dim cmdBar As CommandBar, cmdPopup As CommandBarPopup, cmdButton As CommandBarButton
On Error GoTo ErrorHandler:
Set cmdBar = Application.CommandBars("Cell") '35
Set cmdPopup = cmdBar.Controls.Add(Type:=msoControlPopup, Before:=1)
With cmdPopup
.Caption = "My Popup"
End With
Set cmdButton = cmdPopup.Controls.Add(Type:=msoControlButton)
With cmdButton
.Caption = "This is my macro1"
.OnAction = "Mymacro1"
.FaceId = 370
End With
Set cmdButton = cmdPopup.Controls.Add(Type:=msoControlButton, Before:=1)
With cmdButton
.Caption = "This is my macro2"
.OnAction = "Mymacro2"
.FaceId = 370
End With
Exit Sub
ErrorHandler:
Debug.Print Err.Number & " " & Err.Description
End Sub
Public Sub Mymacro1()
MsgBox "My macro 1"
End Sub
Public Sub Mymacro2()
MsgBox "My macro 2"
End Sub