Thread: Create an .xla
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Bigwheel Bigwheel is offline
external usenet poster
 
Posts: 14
Default Create an .xla

OK. Try this as an example:-

Sub auto_open()
Set myMenuBar = CommandBars.ActiveMenuBar
Set newMenu = myMenuBar.Controls.Add(Type:=msoControlPopup, _
Befo=8, Temporary:=True)
newMenu.Caption = "Wor&k"
Set ctrl1 = newMenu.Controls _
.Add(Type:=msoControlButton, ID:=1)
ctrl1.Caption = "Travel Claim"
ctrl1.TooltipText = "Travel Claim"
ctrl1.Style = msoButtonIcon
ctrl1.OnAction = "LoadTandS" 'name of subroutine to run for this
selection
Set ctrl2 = newMenu.Controls _
.Add(Type:=msoControlButton, ID:=1)
ctrl2.Caption = "Time Sheet"
ctrl2.TooltipText = "Time Sheet"
ctrl2.Style = msoButtonCaption
ctrl2.OnAction = "LoadTimesheet" 'name of subroutine to run
End Sub

Sub auto_close()
Application.CommandBars("Worksheet Menu Bar").Controls("Work").Delete
End Sub

"Dominique Feteau" wrote in message
...
Thanx for the response Bigwheel. To be honest, I dunno what I'd do

without
this board. I will need some help with that code. I'm a beginner with
writing the code, but can understand what the code is doing once it's been
written.