View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
jean grey jean grey is offline
external usenet poster
 
Posts: 19
Default Modifying XLA to show toolbar in XL 2003 and ribbon tab in XL 2007

Hi everyone.
I have an XLA file created using Excel 2003. It has VBA code for defining
the menus and toolbars, and the macros associated with them. So for example,
my VBA code adds the "CustomFunctions" menu and a toolbar by the code:

Set cmbBar = Application.CommandBars("Worksheet Menu Bar")
iHelpIndex = cmbBar.Controls("Help").index

Set cmbControl = cmbBar.Controls.Add(Type:=msoControlPopup,
befo=iHelpIndex)
With cmbControl
.Caption = "CustomFunctions"
With .Controls.Add(Type:=msoControlButton)
.Caption = "Function1"
.OnAction = "Action1"
End With
End With

cmbBar.Visible = True

Set NewButton = cmbBar.Controls.Add(Type:=msoControlButton)
With NewButton
.OnAction = "Action1"
FaceId = 80
End With

My code works perfectly fine. However, I need the same XLA file to be opened
using Excel 2007. I already have an idea on how to create/modify ribbon tabs
in XLSM or XLMA file but what I don't know is how to modify the VBA code of
the old XLA file itself (meaning not to re-write it as XLSM or XLMA) to
change "CustomFunctions" into a new ribbon tab when opened in Excel 2007.
Currently, when I open it, the menu and toolbar are automatically transferred
to the "Add-Ins" tab.

Thanks in advance. :)