Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Old October 9th 06, 10:10 PM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Oct 2006
Posts: 1
Default Need Opinion on Toolbar Creation

I've tried several ways to create and associate a toolbar button with a VBA
macro in Excel.

I'm not completely happy with any of the solutions I've come up with and
would like to know if anyone else out there would like to share their
favorite way of doing this?

The development can be as complex as is necessary.

The trick is that the resulting solution must be simple to implement but
still sturdy enough to hold up against users that can be too "creative".
Suggestions are most appreciated!

Thanks,

SB


  #2   Report Post  
Old October 9th 06, 10:15 PM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Jul 2006
Posts: 35,218
Default Need Opinion on Toolbar Creation

For additions to the worksheet menu bar, I really like the way John Walkenbach
does it in his menumaker workbook:
http://j-walk.com/ss/excel/tips/tip53.htm

Here's how I do it when I want a toolbar:
http://www.contextures.com/xlToolbar02.html
(from Debra Dalgleish's site)

surfbored wrote:

I've tried several ways to create and associate a toolbar button with a VBA
macro in Excel.

I'm not completely happy with any of the solutions I've come up with and
would like to know if anyone else out there would like to share their
favorite way of doing this?

The development can be as complex as is necessary.

The trick is that the resulting solution must be simple to implement but
still sturdy enough to hold up against users that can be too "creative".
Suggestions are most appreciated!

Thanks,

SB


--

Dave Peterson
  #3   Report Post  
Old October 9th 06, 10:19 PM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Jul 2006
Posts: 380
Default Need Opinion on Toolbar Creation

The best way IMO is to create it on startup, and remove it on close-down of
the workbook.

Private Sub Workbook_BeforeClose(Cancel As Boolean)
On Error Resume Next
Application.CommandBars("Worksheet Menu Bar").Controls("Test").Delete
On Error GoTo 0
End Sub

Private Sub Workbook_Open()

On Error Resume Next
Application.CommandBars("Worksheet Menu Bar").Controls("Test").Delete
On Error GoTo 0

With Application.CommandBars("Worksheet Menu Bar")
With .Controls.Add(Type:=msoControlPopup, temporary:=True)
.Caption = "Test"
With .Controls.Add(Type:=msoControlButton)
.Caption = "Test 1"
.FaceId = 169
.OnAction = "myTest1"
End With
With .Controls.Add(Type:=msoControlButton)
.Caption = "Test 2"
.FaceId = 170
.OnAction = "myTest2"
End With
.Visible = True
End With
End With
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code



--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

"surfbored" wrote in message
.. .
I've tried several ways to create and associate a toolbar button with a

VBA
macro in Excel.

I'm not completely happy with any of the solutions I've come up with and
would like to know if anyone else out there would like to share their
favorite way of doing this?

The development can be as complex as is necessary.

The trick is that the resulting solution must be simple to implement but
still sturdy enough to hold up against users that can be too "creative".
Suggestions are most appreciated!

Thanks,

SB





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
VBA Project - Second opinion please! Danny Excel Worksheet Functions 11 September 17th 07 11:03 PM
Opinion on Size/Length of Macro/Function/Sub Rob Excel Programming 2 August 27th 06 05:53 AM
Your opinion CBrausa Excel Discussion (Misc queries) 1 May 18th 06 07:55 PM
Creation of "floating" toolbar Dave Rey Excel Programming 1 August 25th 04 02:02 PM
clear clipboard after Add-ins Toolbar creation Kyoux Excel Programming 3 October 2nd 03 04:05 AM


All times are GMT +1. The time now is 11:49 AM.

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

About Us

"It's about Microsoft Excel"

 

Copyright © 2017