Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have added a custome toolbar with the following code. I would like to add
a tooltip to this button. Also, can I have a button with text instead of the icon? Dim cb As CommandBar Set cb = CommandBars.Add With cb .Name = "SWAP" .Position = msoBarTop End With Set myBar = CommandBars("SWAP") Set myControl = myBar.Controls _ .Add(Type:=msoControlButton, _ Temporary:=True) With myControl .FaceId = 47 .Width = 75 .OnAction = "ResetValues" End With myBar.Visible = True Many Thanks -- Robert Hill |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
One way:
With Application.CommandBars On Error Resume Next .Item("SWAP").Delete On Error GoTo 0 With .Add( _ Name:="SWAP", _ Position:=msoBarTop, _ MenuBar:=False, _ Temporary:=True) With .Controls.Add( _ Type:=msoControlButton, _ Id:=1, _ Befo=1, _ Temporary:=True) '.FaceId = 47 .Width = 75 .Style = msoButtonCaption .Caption = "Caption" .TooltipText = "Tooltip Text" .OnAction = "ResetValues" End With .Visible = True End With End With In article , Robert wrote: I have added a custome toolbar with the following code. I would like to add a tooltip to this button. Also, can I have a button with text instead of the icon? Dim cb As CommandBar Set cb = CommandBars.Add With cb .Name = "SWAP" .Position = msoBarTop End With Set myBar = CommandBars("SWAP") Set myControl = myBar.Controls _ .Add(Type:=msoControlButton, _ Temporary:=True) With myControl .FaceId = 47 .Width = 75 .OnAction = "ResetValues" End With myBar.Visible = True Many Thanks |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks. That worked great. Is there a way to hide macros so that a user
cannot run them? I am not very good with Excel. -- Robert Hill "JE McGimpsey" wrote: One way: With Application.CommandBars On Error Resume Next .Item("SWAP").Delete On Error GoTo 0 With .Add( _ Name:="SWAP", _ Position:=msoBarTop, _ MenuBar:=False, _ Temporary:=True) With .Controls.Add( _ Type:=msoControlButton, _ Id:=1, _ Befo=1, _ Temporary:=True) '.FaceId = 47 .Width = 75 .Style = msoButtonCaption .Caption = "Caption" .TooltipText = "Tooltip Text" .OnAction = "ResetValues" End With .Visible = True End With End With In article , Robert wrote: I have added a custome toolbar with the following code. I would like to add a tooltip to this button. Also, can I have a button with text instead of the icon? Dim cb As CommandBar Set cb = CommandBars.Add With cb .Name = "SWAP" .Position = msoBarTop End With Set myBar = CommandBars("SWAP") Set myControl = myBar.Controls _ .Add(Type:=msoControlButton, _ Temporary:=True) With myControl .FaceId = 47 .Width = 75 .OnAction = "ResetValues" End With myBar.Visible = True Many Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Custom Toolbar | Excel Programming | |||
Custom button on custom toolbar wants to re-load "Personal.xls" | Excel Programming | |||
VBA - Disappearing custom menu and custom toolbar | Excel Programming | |||
custom toolbar buttons are saved where? Excel loads twice bymistake and all my custom toolbar buttons get gone!!! | Excel Programming | |||
saving toolbar buttons on custom toolbar | Excel Programming |