Thread: CommandBars
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Stephen Bullen[_3_] Stephen Bullen[_3_] is offline
external usenet poster
 
Posts: 74
Default CommandBars

Hi Garry,

Private Sub Workbook_AddinInstall()
'create PERMANENT toolbar
Dim cbar As CommandBar, cbct1 As CommandBarControl

MsgBox "install myAppTB"

'create myApptool bar as permanent

'error in next line- Me is wrong, so is Application, what should it be?
Set cbar = Me.CommandBars.Add("MyAppTB", msoBarTop, False, False)


Application should work fine. Normally, I'd delete the toolbar
beforehand, just in case it's already the

On Error Resume next
Application.Commandbars("MyAppTB").Delete

On Error Goto 0
Set cbar = Me.CommandBars.Add("MyAppTB", msoBarTop, False, False)


Private Sub Workbook_AddinUninstall()
'delete PERMANENT toolbar
MsgBox "Uninstall myappTB"
'have not figured this out yet"


On Error Resume next
Application.Commandbars("MyAppTB").Delete

End Sub



Hope that helps

Regards

Stephen Bullen
Microsoft MVP - Excel
www.BMSLtd.ie