Customizing Ribbon - Tab from .mpt, Tab from .mpp RRS feed

  • Question

  • My environment: Windows 7, MS Project Professional 2013 32-bit, no access to Visual Studio.  

    I'm creating a custom ribbon tab, using xml string, that will automatically come up whenever MS Project is opened using the MS Project shortcut or when it is opened by clicking on an existing .mpp file.  This way I can have a tab that contains a set of vba tools I've developed. 

    I believe that the ribbon code needs to be associated to the .mpt file so that always runs.

    I also believe that the code needs to use the Project_Activate event because the Project_Open fires to early if you are just using the MS Project shortcut. (let me know if I'm wrong)

    The problem occurs when there is a custom ribbon associated to the .mpp file.  In my case we are working on a .mpp file that is shared between a vendor and client, and there is a custom ribbon tab specific to the .mpp file.  If the vba to create the custom ribbon is in the .mpp project_activate event the .mpt project_Activate event runs and the .mpp project_activate doesn't seem to run.  If the vba to create the ribbon is in the .mpp project_open then the .mpt project_Activate event runs afterwards, running over the top of it.  Any ideas on how to have both the .mpt and .mpp custom ribbons come up without walking over each other?

    Wednesday, September 23, 2015 11:01 PM


All replies

  • I regularly have a ribbon running from the Global.mpt file but that is always replaced by any ribbon running from an activate event in a .mpp file. You can only have one.

    However you can also manually customize the ribbon as well.

    Rod Gill
    Author of the one and only Project VBA Book

    Friday, September 25, 2015 1:45 AM
  • It would seem that there is no getting around the activate event of the .mpt replacing the .mpp activate event.  Is there a way to be in the .mpt activate event and pull the ribbon xml string to see if customization has occurred already from the .mpp?  Like the setCustomUI, but a getCustomUI? I know that specific function doesn't exist off the same object, but maybe through some other way? Then I can parse the xlm and see if there is customization already and add my stuff to it.  By the way I have your book which lead me to create my own custom tab and the custom tab used by the project with the vendor.  Awesome book!!
    Friday, September 25, 2015 6:09 PM
  • Unfortunately no. You can read the names of existing modules and therefore guess whether there has been any customisation so far.

    Rod Gill
    Author of the one and only Project VBA Book

    • Marked as answer by Rich J Manning Monday, September 28, 2015 2:36 PM
    Saturday, September 26, 2015 5:21 AM