Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 430
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 430
Default 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
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
Control Toolbox button PBS Excel Discussion (Misc queries) 1 March 21st 06 11:39 PM
Vanishing Control Toolbox Command Buttons Fritz24 Excel Discussion (Misc queries) 2 June 7th 05 01:39 PM
Embed command button from the control toolbox doesnt work guichre Excel Worksheet Functions 1 November 16th 04 02:28 AM
Embed command button from the control toolbox doesnt work Roland Excel Worksheet Functions 0 November 16th 04 02:20 AM
Control Toolbox button david Excel Programming 0 August 5th 03 05:28 PM


All times are GMT +1. The time now is 09:48 PM.

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"