If you start from scratch, then using the getVisible attribute to show/hide a tab will not work, since you'd have to rebuild the functionalities for the elements. However, an option would be to simply start all tabs hidden and then show/hide as you go along, this would avoid the frustrating of having to rebuild each tab using XML to work with them.
Remember that working with startFromScratch does not stop the user from hitting shortcut keys to access certain functionalities (at least for now), so it is pretty much pointless to start from scratch except for the fact you’d have all the tabs and certain commands hidden from the outset. Here’s an option to work with an Excel file. Use the following XML to built your own custom tab:
label="My Custom Tab">
label="My Custom Group">
You can then write some code in your workbook as follows to control visibility (place code in a standard module):
Public rx_oRibbon As IRibbonUI
Public blnGetLabelState As Boolean
Public blnHomeTabVisibility As Boolean
Sub rxRibbon_onLoad(ribbon As IRibbonUI)
Set rx_oRibbon = ribbon
blnGetLabelState = False
blnHomeTabVisibility = False
Sub rxtglBtn0_getLabel(control As IRibbonControl, ByRef returnedVal)
Select Case blnGetLabelState
returnedVal = "Hide 'Home Tab'"
returnedVal = "Show 'Home Tab'"
Sub TabHome_getVisible(control As IRibbonControl, ByRef returnedVal)
returnedVal = (blnGetLabelState)
Sub rxtglBtn0_Click(control As IRibbonControl, pressed As Boolean)
blnGetLabelState = pressed