PC Review


Reply
Thread Tools Rate Thread

Custom Command Bar(s) In Excel

 
 
Ruskin Hardie
Guest
Posts: n/a
 
      19th Dec 2005
I am creating a custom command bar, with a button. This works fine;

Const BAR_NAME As String = "TEST"
Dim objButton As CommandBarControl
Dim objToolbar As CommandBar

If Not CommandBars(BAR_NAME) Is Nothing Then CommandBars(BAR_NAME).Delete

Set objToolbar = CommandBars.Add(Name:=BAR_NAME, Position:=1,
Temporary:=True)
objToolbar.Visible = True
objToolbar.Postion = msoBarTop

Set objButton = CommandBars(BAR_NAME).Controls.Add(Type:=msoControlButton)
objButton.TooltipText = "click here to update your data"
objButton.Style = msoButtonIcon
objButton.FaceId = 44


However, I have a problem, in that I want the buttons on this custom command
bar, to be larger (so it shows up more readily). There is a 'LargeButtons'
property, but that is of the CommandBars object. If I set this property to
'True', then all buttons (on the standard toolbars) are large as well, as it
applies to the CommandBars collection object.

I thought of trying something like;

Dim objControls As CommandBars
Dim objBar As CommandBar
Set objBar = Application.CommandBars(BAR_NAME)
'Append the command bar to the command bars collection ??
objControls.LargeButtons = True


This returns a 'CommandBar', now how do I append this command bar object to
the command bars collection or is there another way, to make the icons stand
out more? I have also tried, setting the style property of the
commandbarcontrol to msoButtonCaption and the Caption property to some text,
but I can't change the text format (ie: make it larger or bold).


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
custom command Ross in Oz Microsoft Excel Misc 0 18th Feb 2010 11:52 AM
Adding a Custom Command Button to the Excel 2007 Ribbon Bishop Microsoft Excel Programming 1 18th May 2009 02:43 PM
In Outlook, how do I create and add a custom command to custom men =?Utf-8?B?Q3JlYXRlIGFuZCBhZGQgY3VzdG9tIGNvbW1hbmQg Microsoft Outlook Discussion 0 9th Nov 2007 01:08 AM
Custom Command Bar Richard via AccessMonster.com Microsoft Access Form Coding 2 11th Jul 2005 07:15 PM
Custom Command Bar Tom Ulincy Microsoft Excel Programming 2 16th Mar 2004 03:57 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:52 AM.