none
VBA XML Ribbon now rendering in Project Client 2013 (version: 15.0.4569.15.04) RRS feed

  • Question

  • Hi,

    What I’m trying to do is to add XML ribbon to Project Client 2013 using VBA code. I have a method in my VBA project (mpp file) under “ThisProject”. When this project is open, it passes the xml ribbon to ActiveProject.SetCustomUI (“My XML ribbon content HERE”). I can break point and see the call is being made but ribbon is not visible on the Project Client 2013.

    This ribbon works in only one computer (in Project Client 2013). Right now I have this file stored as a local MPP file, but eventually I have to move this code to Project Server (global-check-out location). There are no error or any issues that I can think.

    Why does this work in one computer but not in other three computers? Is My XML schema and the format correct for Project Client 2013? What kind of permissions does Ribbon requires and how can I check them?

    Below is my VBA/XML ribbon code:

    Private Sub Project_Open(ByVal pj As Project)
        Call AddCustomUI
    End Sub
    
    Sub AddCustomUI()
        Debug.Assert 1 < 0
    
        Dim customUiXml As String
     
        customUiXml = "<mso:cmd app=""MSProject"" dt=""1"" /><mso:customUI xmlns:x1=""http://schemas.microsoft.com/office/2009/07/customui/macro"" xmlns:mso=""http://schemas.microsoft.com/office/2009/07/customui""><mso:ribbon><mso:qat/><mso:tabs><mso:tab id=""PMMTab"" label=""PMM"" insertBeforeQ=""mso:TabAddIns""><mso:group id=""grpPMM1"" label=""PMM Options"" autoScale=""true"">" _
            & "<mso:button idQ=""x1:btnSetOptions"" label=""Set Options"" imageMso=""TableBorderPenColorPicker"" onAction=""btn_ShowSetOptionsForm"" visible=""true""/><mso:button idQ=""x1:btnSetBaseline"" label=""Set Baseline"" imageMso=""VisibilityHidden"" onAction=""btn_ShowSetBaselineForm"" visible=""true""/>" _
            & "<mso:button idQ=""x1:btnSummaries"" label=""Summaries"" imageMso=""DesignXml"" onAction=""btn_InsertATECSummaryTasks"" visible=""true""/><mso:button idQ=""x1:btnExcelRpt"" label=""Excel Report"" imageMso=""AppointmentColor9"" onAction=""btn_ShowExcelReportForm"" visible=""true""/><mso:button idQ=""x1:btnDtLogic"" label=""Date Logic"" imageMso=""AppointmentColor5"" onAction=""btn_ShowDateLogicForm"" visible=""true""/>" _
            & "<mso:button idQ=""x1:btnTskSchedule"" label=""Task Schedule"" imageMso=""Bullets"" onAction=""btn_TaskSchedule"" visible=""true""/><mso:button idQ=""x1:btnClean"" label=""Clean"" imageMso=""InkEraseMode"" onAction=""btn_ShowCleanProjectForm"" visible=""true""/><mso:button idQ=""x1:btnQAS"" label=""QAS"" imageMso=""PositionAbsoluteMarks"" onAction=""btn_LaunchQAS"" visible=""true""/>" _
            & "<mso:button idQ=""x1:btnPMMSite"" label=""PMM Site"" imageMso=""MsnLogo"" onAction=""btn_GoToPMESDocs"" visible=""true""/><mso:button idQ=""x1:btnActOffsets"" label=""Actual Offsets"" imageMso=""LinkBarCustom"" onAction=""btn_calculateActualOffsets"" visible=""true""/><mso:button idQ=""x1:btnATCForm"" label=""ATC Form"" imageMso=""ViewSlideSorterView"" onAction=""btn_GoToATCForm"" visible=""true""/>" _
            & "</mso:group><mso:group id=""grpPMM2"" label=""OTC Options"" autoScale=""true""><mso:button idQ=""x1:btnSetResDefault"" label=""Set Resource Defaults"" imageMso=""ListMacros"" onAction=""btn_SetResourceDefaults"" visible=""true""/></mso:group><mso:group id=""grpPMM3"" label=""External Links"" autoScale=""true""><mso:button idQ=""x1:btnLinkOptions"" label=""Link Options"" imageMso=""ListMacros"" onAction=""btn_LinkOptions"" visible=""true""/>" _
            & "<mso:button idQ=""x1:btnTRPOutline"" label=""TRP Outline"" imageMso=""CondolatoryEvent"" onAction=""btn_TRPOutline"" visible=""true""/><mso:button idQ=""x1:btnSynProject"" label=""Sync Project"" imageMso=""RecordsRefreshMenu"" onAction=""btn_SyncProject"" visible=""true""/><mso:button idQ=""x1:btnDetails"" label=""Details"" imageMso=""SlidesPerPageSlideOutline"" onAction=""btn_Detail"" visible=""true""/>" _
            & "<mso:button idQ=""x1:btnATCTools"" label=""ATEC Tools"" imageMso=""HyperlinksVerify"" onAction=""btn_ATECTools"" visible=""true""/><mso:button idQ=""x1:btnImportActuals"" label=""Import Actuals"" imageMso=""_3DPerspectiveDecrease"" onAction=""btn_ImportActuals"" visible=""true""/><mso:button idQ=""x1:btnAECMenu"" label=""AEC Menu"" imageMso=""ViewFullScreenView"" onAction=""btn_AEC_Menu"" visible=""true""/></mso:group>" _
            & "<mso:group id=""grpPMM4"" label=""Admin Options"" autoScale=""true""><mso:button idQ=""x1:btnChgLog"" label=""Change Log"" imageMso=""ListMacros"" onAction=""btn_ShowChangeLogForm"" visible=""true""/><mso:button idQ=""x1:btnResMaint"" label=""Resource Maint"" imageMso=""CondolatoryEvent"" onAction=""btn_ShowResMaintForm"" visible=""true""/>" _
            & "<mso:button idQ=""x1:btnChkResRate"" label=""Check Resource Rates"" imageMso=""TableDesign"" onAction=""btn_checkResourceRates"" visible=""true""/><mso:button idQ=""x1:btnResReport"" label=""Resource Report"" imageMso=""SlideShowUseRehearsedTimings"" onAction=""btn_ShowSetResourceRatesForm"" visible=""true""/></mso:group></mso:tab></mso:tabs></mso:ribbon></mso:customUI>"
        
         
        ActiveProject.SetCustomUI (customUiXml)
    End Sub
    

    Thanks,

    Thursday, January 15, 2015 4:55 PM

All replies

  • Hello Nick,

    VBA and VSTO are different things. I'd suggest asking MS Project specific questions on the General Office Development  forum instead.

    Thursday, January 15, 2015 5:04 PM
  • Thanks I will do that. Sorry for the thread (first time using this form).
    Friday, January 16, 2015 7:03 PM
  • Hi,


    I don't think it likes xl: in the ids. My utility throws up the following that does work:


    <mso:customUI xmlns:mso=""http://schemas.microsoft.com/office/2009/07/customui""><mso:ribbon><mso:tabs><mso:tab id=""PMM"" label=""PMM""  insertBeforeQ=""mso:TabView""><mso:group id=""PMMOptions"" label=""PMM Options""><mso:button id=""btnSetOptions"" label=""Set Options"" size=""large"" imageMso=""TableBorderPenColorPicker"" onAction=""btn_ShowSetOptionsForm""></mso:button><mso:button id=""btnSetBaseline"" label=""Set Baseline"" size=""large"" imageMso=""VisibilityHidden"" onAction=""btn_ShowSetBaselineForm""></mso:button><mso:button id=""btnSummaries"" label=""Summaries"" size=""large"" imageMso=""DesignXml"" onAction=""btn_InsertATECSummaryTasks""></mso:button><mso:button id=""btnExcelRpt"" label=""Excel Report"" size=""large"" imageMso=""AppointmentColor9"" onAction=""btn_ShowExcelReportForm""></mso:button><mso:button id=""btnDtLogic"" label=""Date Logic"" size=""large"" imageMso=""AppointmentColor5"" onAction=""btn_ShowDateLogicForm""></mso:button><mso:button id=""btnTskSchedule"" label=""Task Schedule"
    " size=""large"" imageMso=""Bullets"" onAction=""btn_TaskSchedule""></mso:button><mso:button id=""btnClean"" label=""Clean"" size=""large"" imageMso=""InkEraseMode"" onAction=""btn_ShowCleanProjectForm""></mso:button><mso:button id=""btnQAS"" label=""QAS"" size=""large"" imageMso=""PositionAbsoluteMarks"" onAction=""btn_LaunchQAS""></mso:button><mso:button id=""btnPMMSite"" label=""PMM Site"" size=""large"" imageMso=""MsnLogo"" onAction=""btn_GoToPMESDocs""></mso:button><mso:button id=""btnActOffsets"" label=""Actual Offsets"" size=""large"" imageMso=""LinkBarCustom"" onAction=""btn_calculateActualOffsets""></mso:button><mso:button id=""btnATCForm"" label=""ATC Form"" size=""large"" imageMso=""ViewSlideSorterView"" onAction=""btn_GoToATCForm""></mso:button></mso:group><mso:group id=""OTCOptions"" label=""OTC Options""><mso:button id=""btnSetResDefault"" label=""Set Resource Defaults"" size=""large"" imageMso=""ListMacros"" onAction=""btn_SetResourceDefaults""></mso:button></mso:group><mso:group id=""External
    Links"" label=""External Links""><mso:button id=""btnLinkOptions"" label=""Link Options"" size=""large"" imageMso=""ListMacros"" onAction=""btn_LinkOptions""></mso:button><mso:button id=""btnTRPOutline"" label=""TRP Outline"" size=""large"" imageMso=""CondolatoryEvent"" onAction=""btn_TRPOutline""></mso:button><mso:button id=""btnSynProject"" label=""Sync Project"" size=""large"" imageMso=""RecordsRefreshMenu"" onAction=""btn_SyncProject""></mso:button><mso:button id=""btnDetails"" label=""Details"" size=""large"" imageMso=""SlidesPerPageSlideOutline"" onAction=""btn_Detail""></mso:button><mso:button id=""btnATCTools"" label=""ATEC Tools"" size=""large"" imageMso=""HyperlinksVerify"" onAction=""btn_ATECTools""></mso:button><mso:button id=""btnImportActuals"" label=""Import Actuals"" size=""large"" imageMso=""_3DPerspectiveDecrease"" onAction=""btn_ImportActuals""></mso:button><mso:button id=""btnAECMenu"" label=""AEC Menu"" size=""large"" imageMso=""ViewFullScreenView"" onAction=""btn_AEC_Menu""></mso:button
    ></mso:group><mso:group id=""AdminOptions"" label=""Admin Options""><mso:button id=""btnChgLog"" label=""Change Log"" size=""large"" imageMso=""ListMacros"" onAction=""btn_ShowChangeLogForm""></mso:button><mso:button id=""btnResMaint"" label=""Resource Maint"" size=""large"" imageMso=""CondolatoryEvent"" onAction=""btn_ShowResMaintForm""></mso:button><mso:button id=""btnChkResRate"" label=""Check Resource Rates"" size=""large"" imageMso=""TableDesign"" onAction=""btn_checkResourceRates""></mso:button><mso:button id=""btnResReport"" label=""Resource Report"" size=""large"" imageMso=""SlideShowUseRehearsedTimings"" onAction=""btn_ShowSetResourceRatesForm""></mso:button></mso:group></mso:tab></mso:tabs></mso:ribbon></mso:customUI>

    You'll need to


    Rod Gill
    Author of the one and only Project VBA Book
    www.project-systems.co.nz

    Sunday, January 18, 2015 9:45 PM
    Moderator
  • Rod - Thanks for the help, but it did not work. I feel like there must be a separate Permission for the XML ribbon. I can run the macros but may be my group policy overriding this...

    Let me know if anyone know which policy or permission do i need to run the Ribbon XML?

    Thanks,

    Thursday, January 22, 2015 2:43 PM
  • None. the

    ActiveProject.SetCustomUI (customUiXml)

    code should run for everyone.

    Break my string into separate lines then cut all all code except one of the buttons. If that fails try a different button. If it works add buttons back until you find the faulty code.

    The above string works for me on my PC.


    Rod Gill
    Author of the one and only Project VBA Book
    www.project-systems.co.nz

    Thursday, January 29, 2015 3:47 AM
    Moderator