Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Command Button from Control Toolbox
Can I (somehow) have a command button which is stationary (at a given
position - on Workbook open) and remains Visible and available as I activate to review different Worksheets? (a "floater" button).. Thanks in Advance, |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Command Button from Control Toolbox
YOU CAN MAKE A SEPARATE TOOLBAR FOR EXCEL, WHICH CAN FLOAT OR YOU CAN ATTACH TO THE OTHER TOOLBARS AT TOP. YOU CAN MAKE IT VISIBLE UPON OPENING, AND THEN HIDE IT BEFORE CLOSING. THE FOLLOWING WILL CREATE THIS TOOLBAR WITH TWO BUTTONS THAT LINK TO A MACRO private sub workbook_open goto skp error1: Call ButtonInstall skp: on error goto error1 Application.CommandBars("mybuttons").Visible = True on error goto 0 end sub private sub workbook_close Application.CommandBars("mybuttons").Visible = false end sub sub ButtonInstall Dim NewToolbar As Object Dim NewButton As Object Set NewToolbar = Application.CommandBars.Add(Name:="mybuttons", temporary:=False) NewToolbar.Visible = True Set NewButton = NewToolbar.Controls.Add(Type:=msoControlButton, ID:=2950) With NewButton ..FaceId = 583 ..OnAction = "Name of Macro1 here" ..Caption = "Macro1 description here" End With Set NewButton = NewToolbar.Controls.Add(Type:=msoControlButton, ID:=2950) With NewButton ..FaceId = 45 ..OnAction = "Name of Macro2 here" ..Caption = "Macro2 description here" End With End Sub -- lcoreyl ------------------------------------------------------------------------ lcoreyl's Profile: http://www.excelforum.com/member.php...fo&userid=2042 View this thread: http://www.excelforum.com/showthread...hreadid=557584 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Command Button from Control Toolbox
Thanks lcorey1;
Much appreciated "lcoreyl" wrote in message : YOU CAN MAKE A SEPARATE TOOLBAR FOR EXCEL, WHICH CAN FLOAT OR YOU CAN ATTACH TO THE OTHER TOOLBARS AT TOP. YOU CAN MAKE IT VISIBLE UPON OPENING, AND THEN HIDE IT BEFORE CLOSING. THE FOLLOWING WILL CREATE THIS TOOLBAR WITH TWO BUTTONS THAT LINK TO A MACRO private sub workbook_open goto skp error1: Call ButtonInstall skp: on error goto error1 Application.CommandBars("mybuttons").Visible = True on error goto 0 end sub private sub workbook_close Application.CommandBars("mybuttons").Visible = false end sub sub ButtonInstall Dim NewToolbar As Object Dim NewButton As Object Set NewToolbar = Application.CommandBars.Add(Name:="mybuttons", temporary:=False) NewToolbar.Visible = True Set NewButton = NewToolbar.Controls.Add(Type:=msoControlButton, ID:=2950) With NewButton .FaceId = 583 .OnAction = "Name of Macro1 here" .Caption = "Macro1 description here" End With Set NewButton = NewToolbar.Controls.Add(Type:=msoControlButton, ID:=2950) With NewButton .FaceId = 45 .OnAction = "Name of Macro2 here" .Caption = "Macro2 description here" End With End Sub -- lcoreyl ------------------------------------------------------------------------ lcoreyl's Profile: http://www.excelforum.com/member.php...fo&userid=2042 View this thread: http://www.excelforum.com/showthread...hreadid=557584 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Control Toolbox button | Excel Discussion (Misc queries) | |||
Vanishing Control Toolbox Command Buttons | Excel Discussion (Misc queries) | |||
Embed command button from the control toolbox doesnt work | Excel Worksheet Functions | |||
Embed command button from the control toolbox doesnt work | Excel Worksheet Functions | |||
Control Toolbox button | Excel Programming |