LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.sdk
external usenet poster
 
Posts: 14
Default Toolbars and menus

Hi

i am having a real knightmare with this. The first sub routine
CreateAddin_Toolbar works with no problems. The second sub routine Menu
works okay. This was an example i got from a help file. What i want to do is
to convert it into the same format as the routine CreateAddin_Toolbar. I am
having problems with this as at the top of my module i have declared the
Option Explicit.

Any ideas?

Next I have put a combo box onto the toolbar how do i reference what
somebody has selected on that toolbar, ie item 1 or 2.

D

Sub CreateAddin_Toolbar()

Dim lcbGrad As CommandBar

Set lcbGrad = CommandBars.Add(strMenuBarName, msoBarFloating, , True)
With lcbGrad
With .Controls
'the code below adds a button
With .Add(msoControlButton)
.Style = msoButtonIcon
.FaceId = 463
.Caption = "About"
.OnAction = "About"
End With
With .Add(msoControlComboBox)
.AddItem "Test", 1
.AddItem "Two", 2
.DropDownLines = 3
.DropDownWidth = 75
.ListHeaderCount = 0
End With
With .Add(msoControlDropdown)
.AddItem "Test", 1
.AddItem "Two", 2
.DropDownLines = 3
.DropDownWidth = 75
.ListHeaderCount = 0
End With
With .Add(msoControlPopup)
.Caption = "About"
.OnAction = "About"
End With

End With
'ensures the bar is visible.
.Visible = True

End With
End Sub

'fdsssssssssssssssssssssssss
Sub Menu()
Set mymenubar = CommandBars.ActiveMenuBar
Set newMenu = mymenubar.Controls.Add(Type:=msoControlPopup, _
Temporary:=True)
newMenu.Caption = "Custom"
Set ctrl1 = newMenu.Controls _
.Add(Type:=msoControlButton, ID:=1)
ctrl1.Caption = "Import"
ctrl1.TooltipText = "Import"
ctrl1.Style = msoButtonCaption
End Sub




End Sub


 
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
Menus and Toolbars Needy Ned Excel Discussion (Misc queries) 1 November 6th 08 04:45 PM
Custom Menus and Toolbars TedZee Excel Discussion (Misc queries) 1 July 6th 07 12:16 AM
Missing menus and toolbars Graham Haughs Excel Discussion (Misc queries) 1 December 23rd 05 07:53 PM
No menus, no toolbars, no nothing!! CR[_4_] Excel Programming 4 September 16th 05 03:50 PM
Restricting use of menus and toolbars Brian Excel Programming 1 October 31st 03 04:51 PM


All times are GMT +1. The time now is 10:28 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"