Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 183
Default Custom toolbars (not again!!!)

Hi

You've helped so much with this but I am going wild with frustration. I
copied your code exactly and it is creating a toolbar and button on the fly.
But I want the button to display text and am using the following code. But
it is just showing a blank button? It runs the macro fine and the tool tip
shows. Any help would be really, really appreciated!!

Sub make_menu()
Dim cbar As CommandBar
Dim cbarcontrol As CommandBarControl
'delete the previous version if it exists
Call delete_menu

Set cbar = Application.CommandBars.Add(Name:="tester", temporary:=True)

cbar.Visible = True
cbar.Position = msoBarTop

Set cbarcontrol = cbar.Controls.Add(Type:=msoButtonCaption)
With cbarcontrol
.Caption = "All"
.OnAction = "All"
.Visible = True

End With
End Sub
--
Sharon
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Custom toolbars (not again!!!)

Set cbarcontrol = cbar.Controls.Add(Type:=msoButtonCaption)
should be

Set cbarcontrol = cbar.Controls.Add(Type:=msoControlButton)


--
Regards,
Tom Ogilvy



"Sharon" wrote:

Hi

You've helped so much with this but I am going wild with frustration. I
copied your code exactly and it is creating a toolbar and button on the fly.
But I want the button to display text and am using the following code. But
it is just showing a blank button? It runs the macro fine and the tool tip
shows. Any help would be really, really appreciated!!

Sub make_menu()
Dim cbar As CommandBar
Dim cbarcontrol As CommandBarControl
'delete the previous version if it exists
Call delete_menu

Set cbar = Application.CommandBars.Add(Name:="tester", temporary:=True)

cbar.Visible = True
cbar.Position = msoBarTop

Set cbarcontrol = cbar.Controls.Add(Type:=msoButtonCaption)
With cbarcontrol
.Caption = "All"
.OnAction = "All"
.Visible = True

End With
End Sub
--
Sharon

Reply
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
Custom Toolbars Tami Excel Worksheet Functions 1 August 7th 09 04:14 AM
Custom Toolbars..? Andrew[_9_] Excel Discussion (Misc queries) 2 January 20th 09 12:54 AM
Custom toolbars Ian Anderson Excel Discussion (Misc queries) 0 February 18th 06 08:04 PM
Custom Toolbars blackfish Excel Programming 1 December 23rd 05 09:32 PM
Custom ToolBars Julian[_3_] Excel Programming 1 January 8th 04 06:22 PM


All times are GMT +1. The time now is 05:04 AM.

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

About Us

"It's about Microsoft Excel"