G
Guest
I have created an xla that adds a new menu to the worksheet menu bar at
startup, it allows me to access files. I can go into the Tools, addins menu
and add the xla and it appears on the command bar. but when I close down
excel and reopen it the addin does not appear.
I had excel 2000 up to a few days ago and my addin worked perfectly but now
that i have upgraded to excel 2002 i am having this problem. Can someone
please help? thanks if you can.
Here is my code.
Private Sub Workbook_AddinUninstall()
Call DeleteMenu
End Sub
Private Sub Workbook_AddinInstall()
Call AddMenus
End Sub
Public Sub AddMenus()
Dim cMenu1 As CommandBarControl
Dim cbMainMenuBar As CommandBar
Dim iHelpMenu As Integer
Dim cbcCutomMenu As CommandBarControl
On Error Resume Next
Application.CommandBars("Worksheet Menu Bar").Controls("&Andy
Files").Delete
Set cbMainMenuBar = _
Application.CommandBars("Worksheet Menu Bar")
iHelpMenu = _
cbMainMenuBar.Controls("Data").Index
Set cbcCutomMenu = _
cbMainMenuBar.Controls.Add(Type:=msoControlPopup,
before:=iHelpMenu)
cbcCutomMenu.Caption = "&Andy Files"
With cbcCutomMenu.Controls.Add(Type:=msoControlButton)
.Caption = "&Limit Monitor"
.OnAction = "OpenLimitMonitor"
End With
With cbcCutomMenu.Controls.Add(Type:=msoControlButton)
.Caption = "&My Work"
.OnAction = "OpenAndyWork"
End With
On Error GoTo 0
End Sub
Public Sub DeleteMenu()
On Error Resume Next
Application.CommandBars("Worksheet Menu Bar").Controls("&Andy
Files").Delete
On Error GoTo 0
End Sub
startup, it allows me to access files. I can go into the Tools, addins menu
and add the xla and it appears on the command bar. but when I close down
excel and reopen it the addin does not appear.
I had excel 2000 up to a few days ago and my addin worked perfectly but now
that i have upgraded to excel 2002 i am having this problem. Can someone
please help? thanks if you can.
Here is my code.
Private Sub Workbook_AddinUninstall()
Call DeleteMenu
End Sub
Private Sub Workbook_AddinInstall()
Call AddMenus
End Sub
Public Sub AddMenus()
Dim cMenu1 As CommandBarControl
Dim cbMainMenuBar As CommandBar
Dim iHelpMenu As Integer
Dim cbcCutomMenu As CommandBarControl
On Error Resume Next
Application.CommandBars("Worksheet Menu Bar").Controls("&Andy
Files").Delete
Set cbMainMenuBar = _
Application.CommandBars("Worksheet Menu Bar")
iHelpMenu = _
cbMainMenuBar.Controls("Data").Index
Set cbcCutomMenu = _
cbMainMenuBar.Controls.Add(Type:=msoControlPopup,
before:=iHelpMenu)
cbcCutomMenu.Caption = "&Andy Files"
With cbcCutomMenu.Controls.Add(Type:=msoControlButton)
.Caption = "&Limit Monitor"
.OnAction = "OpenLimitMonitor"
End With
With cbcCutomMenu.Controls.Add(Type:=msoControlButton)
.Caption = "&My Work"
.OnAction = "OpenAndyWork"
End With
On Error GoTo 0
End Sub
Public Sub DeleteMenu()
On Error Resume Next
Application.CommandBars("Worksheet Menu Bar").Controls("&Andy
Files").Delete
On Error GoTo 0
End Sub