I have a spreadsheet for analyzing language discourse structure. It has a lot of VBA and has worked on Excel 2003, 2007, 2010, 2013 for Windows and Excel for Mac 2011. However, now in Excel 2016, I get this error and none of the code runs.

Here is the section of code where the error occurs. The bold line is the line highlighted in debug. Any ideas?
Select Case MenuLevel
Case 1 ' A Menu
' Add the top-level menu to the Worksheet CommandBar
If NextLevel = 2
Then
Set MenuItem = MenuObject.Controls.Add(Type:=msoControlPopup)
MenuItem.Caption = Caption
Else
Set MenuItem = MenuObject.Controls.Add(Type:=msoControlButton)
With MenuItem
.Caption = Caption
If actionchoice = 0
Then
.OnAction = "Entersometext(""" + texttoenter + """)"
Else
.OnAction = "AltEntertext(""" + texttoenter + """)"
End
If
End
With
End
If
Case 2 ' A Menu Item
Set SubMenuItem = MenuItem.Controls.Add(Type:=msoControlButton)
With SubMenuItem
.Caption = Caption
If actionchoice = 0
Then
.OnAction = "Entersometext(""" + texttoenter + """)"
Else
.OnAction = "AltEntertext(""" + texttoenter + """)"
End
If
End
With
End Select