Consulting

Results 1 to 1 of 1

Thread: Macro callback not working on XML custom tab

  1. #1
    VBAX Newbie
    Joined
    Jul 2017
    Posts
    2
    Location

    Macro callback not working on XML custom tab

    I'm creating a custom tab in MS Project using VBA and XML. On the ProjectGlobal I have the following:


    Inside ThisProject(Global.MPT)
    
    Private Sub Project_Activate(ByVal pj AsMSProject.Project)
    
    
    ribbonXml ="<mso:customUI xmlns:x1=""htp://schemas.microsoft.com/office/2009/07/customui/macro"" xmlns:mso=""htp://schemas.microsoft.com/office/2009/07/customui"">"
    ribbonXml = ribbonXml +"<mso:ribbon>"
    ribbonXml = ribbonXml +"<mso:qat/>"
    ribbonXml = ribbonXml +"<mso:tabs>"
    ribbonXml = ribbonXml +"<mso:tab id=""mso_c1.497B55B8"" label=""Produtos Novos"">"
    ribbonXml = ribbonXml +"<mso:group id=""mso_c2.497B55B8"" label=""New Product"" imageMso=""ViewGoForward"" autoScale=""true"">"
    ribbonXml = ribbonXml +"<mso:button idQ=""x1:newProjectPN"" label=""New Project (NOK)"" imageMso=""CategoryCollapse"" onAction=""newProjectPN"" visible=""true"" />"
    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
    Then I have a module with the following
    Public Sub newProjectPN(Control As IRibbonControl)
    
    MsgBox"Not working yet. Please be patient "
    
    End Sub
    It creates the tab with the button as expected, but when I click the button it does nothing. How do I reference the macro in XML strings?
    Last edited by SamT; 07-13-2017 at 10:06 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •