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: 16
Default addin and main menu disappears

Hi, I've created addin with small toolbar and additional subs connected
to buttons. But when I'm opening Excel (2003) and my addin is loaded,
main menu ( File, Edit etc.) is disappearing :( How can i resolve that
problem?

Here is my code for my toolbar in ThisWorkbook:

Private Sub Workbook_BeforeClose(Cancel As Boolean)
DeleteCommandbar
End Sub
Private Sub Workbook_Open()
CreateCommandbar
End Sub
Sub CreateCommandbar()
Const CStCmdBar As String = "Platnosci"
Call DeleteCommandbar
With Application.CommandBars.Add(CStCmdBar, msoBarFloating, True, True)
..Visible = True
..Position = msoBarTop
..RowIndex = Application.CommandBars("Formatting").RowIndex
..Protection = msoBarNoChangeVisible + msoBarNoCustomize + msoBarNoMove
With .Controls
With .Add(msoControlButton) ' first button
..Style = msoButtonIcon
..FaceId = 107
..OnAction = "ThisWorkbook.Listaplat"
..TooltipText = "Lista platnosci"
End With
With .Add(msoControlButton) 'second button
..Style = msoButtonIcon
..FaceId = 144
..TooltipText = "Platnosci"
..OnAction = "ThisWorkbook.Platnosci"
End With
End With
End With
Application.CommandBars("Worksheet Menu Bar").Enabled = True
End Sub
Sub DeleteCommandbar()
On Error Resume Next
CommandBars("Platnosci").Delete
End Sub

Przemek

 
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
Unhide Main Menu Bar Dkline Excel Worksheet Functions 2 February 2nd 07 09:31 PM
Main menu is missing Deb G Excel Discussion (Misc queries) 3 May 10th 05 07:46 PM
Why has my main menu bar suddenly disappeared? JR Mac MacKay Excel Discussion (Misc queries) 1 April 26th 05 05:32 PM
New Main menu item Cynthia[_4_] Excel Programming 7 May 9th 04 12:35 AM
Pulldown Sub-menus within the main menu! aiyer[_10_] Excel Programming 1 April 7th 04 09:09 PM


All times are GMT +1. The time now is 01:13 AM.

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"