title: How to add a custom Ribbon tab using VBA?
body: <p>I am looking for a way to add a custom tab in the Excel ribbon which would carry a few buttons. I chanced on some resources addressing it via Google but all look dodgy and outrageously complicated. </p>
  
  <p>What is a quick and simple way to do that ? I'd like the new tab to get loaded when my VBA gets loaded into Excel..</p>
  
  <p><strong>UPDATE</strong> : 
  I tried this example from <a href="http://msdn.microsoft.com/en-us/library/ee767705.aspx" rel="noreferrer">here</a> but get an "object required" error on the last instruction :</p>
  
  <pre><code>Public Sub AddHighlightRibbon()
  Dim ribbonXml As String
  
  ribbonXml = "&lt;mso:customUI xmlns:mso=""http://schemas.microsoft.com/office/2009/07/customui""&gt;"
  ribbonXml = ribbonXml + "  &lt;mso:ribbon&gt;"
  ribbonXml = ribbonXml + "    &lt;mso:qat/&gt;"
  ribbonXml = ribbonXml + "    &lt;mso:tabs&gt;"
  ribbonXml = ribbonXml + "      &lt;mso:tab id=""highlightTab"" label=""Highlight"" insertBeforeQ=""mso:TabFormat""&gt;"
  ribbonXml = ribbonXml + "        &lt;mso:group id=""testGroup"" label=""Test"" autoScale=""true""&gt;"
  ribbonXml = ribbonXml + "          &lt;mso:button id=""highlightManualTasks"" label=""Toggle Manual Task Color"" "
  ribbonXml = ribbonXml + "imageMso=""DiagramTargetInsertClassic"" onAction=""ToggleManualTasksColor""/&gt;"
  ribbonXml = ribbonXml + "        &lt;/mso:group&gt;"
  ribbonXml = ribbonXml + "      &lt;/mso:tab&gt;"
  ribbonXml = ribbonXml + "    &lt;/mso:tabs&gt;"
  ribbonXml = ribbonXml + "  &lt;/mso:ribbon&gt;"
  ribbonXml = ribbonXml + "&lt;/mso:customUI&gt;"
  
  ActiveProject.SetCustomUI (ribbonXml)
  End Sub
  </code></pre>