I have two VBA macros that create a custom tab in MS Project 2013. The three macros are:
Private Sub Project_Open(ByVal pj As Project)
AddEVMRibbon
End Sub
Private Sub removeEVMRibbon()
ribbonXml = "<mso:customUI xmlns:mso=""http://schemas.microsoft.com/office/2009/07/customui"">" & "<mso:ribbon></mso:ribbon></mso:customUI>"
ActiveProject.SetCustomUI (ribbonXml)
End Sub
Private Sub AddEVMRibbon()
Dim ribbonXml As String
ribbonXml = "<mso:customUI xmlns:mso=""http://schemas.microsoft.com/office/2009/07/customui"">"
ribbonXml = ribbonXml + " <mso:ribbon>"
ribbonXml = ribbonXml + " <mso:qat/>"
ribbonXml = ribbonXml + " <mso:tabs>"
ribbonXml = ribbonXml + " <mso:tab id=""macroTab"" label=""EVM"" insertAfterQ=""mso:TabFormat"">"
ribbonXml = ribbonXml + " <mso:group id=""testGroup"" label=""Test"" autoScale=""true"">"
ribbonXml = ribbonXml + " <mso:button id=""export_to_excel"" label=""Set EVM Calc Method"" "
ribbonXml = ribbonXml + "imageMso=""DiagramTargetInsertClassic"" onAction=""Set_EVM_Method""/>"
ribbonXml = ribbonXml + " <mso:button id=""get_evm_method"" label=""EVM to Excel"" "
ribbonXml = ribbonXml + "imageMso=""DiagramTargetInsertClassic"" onAction=""evm_to_excel""/>"
ribbonXml = ribbonXml + " </mso:group>"
ribbonXml = ribbonXml + " </mso:tab>"
ribbonXml = ribbonXml + " </mso:tabs>"
ribbonXml = ribbonXml + " </mso:ribbon>"
ribbonXml = ribbonXml + "</mso:customUI>"
ActiveProject.SetCustomUI (ribbonXml)
End Sub
These work correctly in MS Project 2013, but today I got the opportunity to run them with MS Project 2016, and they fail, rather spectacularly.
In both Project 2013 and 2016 the EVM Tab appears correctly and the two options, "Set EVM Method" and "EVM to Excel," appear when that custom tab is clicked.
In Project 2013 clicking on an option executes the VBA macro associated with the option in the XML. In Project 2016 simply hovering the mouse over either of the two options causes Project to fail immediately, giving me the "Microsoft Project has stopped working" then "Microsoft Project is restarting" messages.
I never have a chance to click the option, as it fails immediately when the cursor touches the option.
Has something changed between Project 2013 and 2016 that would cause this custom ribbon bar tab to fail in 2016? I have not been able to find anything referring to such a change.
Do custom tabs and their options in Project 2016 need to be coded differently than in 2013? Any and all help will be appreciated.