I struggled like mad, but this is actually the right answer. For what it is worth, what I missed was is this:
- As others say, one can't create the CustomUI ribbon with VBA, however, you don't need to!
- The idea is you create your xml Ribbon code using Excel's File > Options > Customize Ribbon, and then export the Ribbon to a .customUI file (it's just a txt file, with xml in it)
- Now comes the trick: you can include the .customUI code in your .xlsm file using the MS tool they refer to here, by copying the code from the .customUI file
- Once it is included in the .xlsm file, every time you open it, the ribbon you defined is
added to the user's ribbon - but do use < ribbon startFromScratch="false" > or you lose the rest of the ribbon. On exit-ing the workbook, the ribbon is removed.
- From here on it is simple, create your ribbon, copy the xml code that is specific to your ribbon from the .customUI file, and place it in a wrapper as shown above (...< tabs> your xml < /tabs...)
By the way the page that explains it on Ron's site is now at
http://www.rondebruin.nl/win/s2/win002.htm
And here is his example on how you enable /disable buttons on the Ribbon
http://www.rondebruin.nl/win/s2/win013.htm
For other xml examples of ribbons please also see
http://msdn.microsoft.com/en-us/library/office/aa338202%28v=office.12%29.aspx