title: Excel VBA Costum ribbon tab order
body: <p>I'm trying to make a custom tab for others with some macro's.</p>
  
  <p>I found this article: <a href="https://stackoverflow.com/questions/8850836/how-to-add-a-custom-ribbon-tab-using-vba">How to add a custom Ribbon tab using VBA?</a></p>
  
  <p>In this article, the reply of Roi-Kyi Bryant is very helpful and works great for me.
  But I have one question about it. Can I reorder the tabs with this VBA code? I know its possible to move it by myself when I click on the ribbon with the right button on the mouse and choose edit ribbon.</p>
  
  <p>any ideas?</p>
  
  <p>The code I use from Roi-Kyi Bryant is as following:</p>
  
  <pre><code>Sub LoadCustRibbon()
  
  Dim hFile As Long
  Dim path As String, fileName As String, ribbonXML As String, user As String
  
  hFile = FreeFile
  user = Environ("Username")
  path = "C:\Users\" &amp; user &amp; "\AppData\Local\Microsoft\Office\"
  fileName = "Excel.officeUI"
  
  ribbonXML = "&lt;mso:customUI      xmlns:mso='http://schemas.microsoft.com/office/2009/07/customui'&gt;" &amp;     vbNewLine
  ribbonXML = ribbonXML + "  &lt;mso:ribbon&gt;" &amp; vbNewLine
  ribbonXML = ribbonXML + "    &lt;mso:qat/&gt;" &amp; vbNewLine
  ribbonXML = ribbonXML + "    &lt;mso:tabs&gt;" &amp; vbNewLine
  ribbonXML = ribbonXML + "      &lt;mso:tab id='reportTab' label='Reports' insertBeforeQ='mso:TabFormat'&gt;" &amp; vbNewLine
  ribbonXML = ribbonXML + "        &lt;mso:group id='reportGroup' label='Reports' autoScale='true'&gt;" &amp;             vbNewLine
  ribbonXML = ribbonXML + "          &lt;mso:button id='runReport' label='PTO' "   &amp; vbNewLine
  ribbonXML = ribbonXML + "imageMso='AppointmentColor3'      onAction='GenReport'/&gt;" &amp; vbNewLine
  ribbonXML = ribbonXML + "        &lt;/mso:group&gt;" &amp; vbNewLine
  ribbonXML = ribbonXML + "      &lt;/mso:tab&gt;" &amp; vbNewLine
  ribbonXML = ribbonXML + "    &lt;/mso:tabs&gt;" &amp; vbNewLine
  ribbonXML = ribbonXML + "  &lt;/mso:ribbon&gt;" &amp; vbNewLine
  ribbonXML = ribbonXML + "&lt;/mso:customUI&gt;"
  
  ribbonXML = Replace(ribbonXML, """", "")
  
  Open path &amp; fileName For Output Access Write As hFile
  Print #hFile, ribbonXML
  Close hFile
  
  End Sub
  </code></pre>