LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Custom Menu Add Problem

I have this code in ThisWorkbook in an add in .xla

Private Sub Workbook_Open()
Dim cbWsMenuBar As CommandBar
Dim TrCustom As CommandBarControl
Dim iHelpIndex As Integer

Set cbWsMenuBar = Application.CommandBars("Worksheet Menu Bar")
iHelpIndex = cbWsMenuBar.Controls("Help").Index
Set TrCustom = cbWsMenuBar.Controls.Add(Type:=msoControlPopup,
befo=iHelpIndex)
With TrCustom
.Caption = "Translate"

With .Controls.Add(Type:=msoControlButton)
.Caption = "Refresh Branch List"
.OnAction = "'ERAC_Universal_Translate7x.xla'!Group_Branch "
End With

With .Controls.Add(Type:=msoControlButton)
.Caption = "Refresh Account List"
.OnAction = "'ERAC_Universal_Translate7x.xla'!AccountList"
End With

End With

When I open Excel I briefly see the new menu item on the menu bar but is
disappears when Excel automatically adds a new workbook "Book1". If I run
the private sub after everything is open the menu is added and it works. But
when I close and reopen Excel it doesn't persist. Any idea where I should
look to figure out what is wiping this out?

Thanks,
John
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding Sub Menu Item to Current Custom Menu Renato Excel Programming 2 December 19th 05 12:48 AM
problem with custom menu Tony Excel Programming 2 May 4th 05 08:20 AM
problem with custom menu Tony Excel Programming 4 May 3rd 05 02:27 PM
VBA - Disappearing custom menu and custom toolbar Peter[_50_] Excel Programming 2 December 2nd 04 06:09 PM
Custom Menu return to Excel Menu upon Closing VetcalcReport Excel Programming 2 August 2nd 04 02:59 PM


All times are GMT +1. The time now is 01:38 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"