I am troubleshooting a macro I inherited. This macro is for a database upload. The problem is since we upgraded to Excel 2013, this code does not appear to be running as each time the upload spreadsheet is opened another &ProjectionsUpload menu appears (there are four now). I can right click on them and delete them but as soon as the spreadsheet is opened again they reappear. I did delete Office Cache but that does not help. Any thoughts on changes to this code for Excel 2013? I am a beginner at VB so any help is appreciated.
Public Sub RemoveBudgetMenu()
' Remove custom menu for Projection from the menu bar
' This is called from ThisWorkbook when file is closed
Dim cbWSMenuBar As CommandBar
Dim i As Integer
On Error Resume Next
Set cbWSMenuBar = CommandBars("Worksheet Menu Bar")
With cbWSMenuBar
For i = .Controls.Count To 1 Step -1
If .Controls(i).Tag = sMenuTag And .Controls(i).Caption = "&ProjectionsUpload" Then
.Controls(i).Delete
Exit For
End If
Next i
End With
' cbWSMenuBar.Controls(sMenuName).Delete
End Sub
Bookmarks