Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 40
Default Form buttons vs. ActiveX Buttons

I am working on an XL 2007 project requiring command buttons on a form. When
I go into the developer tab and activate the design mode and then select
insert, I am presented with 2 options for a button - a "form" button" or an
"Active X" button. I am trying to determine the advantanges and
disadvantages of each type vs. the other. So far this is what I have come up
with...

1) Both types are flexible in appearance, e. g. the button size, location,
shape, text, text format, size and color, background color are all
changeable.

2) the only way to change the name of a form button is with VBA code, e. g.


Sub ChangeButtonName()

activesheet.Shapes("Button1").Name = "Delete Departments Instructions"
End Sub

OTOH, the name of an ActiveX button can be changed by entering the
Designer mode and right clicking on the button and then selecting properties
and changing the name property. The name of a form button may have spaces in
it whereas the name of an ActiveX button may not


3) The code executed when an ActiveX button is pressed *must* be on the
code sheet for the worksheet on which the button is located, and the routine
must have a name corresponding to the button, e. g.

Private Sub CommandButton1_Click()
MsgBox "Hello from CommandButton1"
End Sub

OTOH a form button can be given the name of the routine to execute when the
button is pressed, and this routine can be located in any VBA module. What's
more, the routine can even be declared private!

Am I correct in what I have stated about the 2 kinds of buttons? Which kind
is recommended?

P.S. I have been speaking of command buttons, but as for labels, the
"Active X" kind seems better than the form kind because I can change the text
size and color of Active X labels but can't seem to do that for form labels.
It is possble to change text size and font and color on a form label ?


Thanks in advance


--
-regards
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,718
Default Form buttons vs. ActiveX Buttons

2) the only way to change the name of a form button is with VBA code

Nope. Select the Forms toolbar button, then click in the Name box to the
left of the Formula bar and you can edit the name.

background color are all changeable.


I don't believe that's true of Forms buttons.

For my part I always use Forms buttons unless there is some feature of a
Control Toolbox button I need. They are simpler and lighter weight and
maybe more stable. Not a lot it in though so you really can't go wrong.


--
Jim
"GeorgeJ" wrote in message
...
I am working on an XL 2007 project requiring command buttons on a form.
When
I go into the developer tab and activate the design mode and then select
insert, I am presented with 2 options for a button - a "form" button" or
an
"Active X" button. I am trying to determine the advantanges and
disadvantages of each type vs. the other. So far this is what I have come
up
with...

1) Both types are flexible in appearance, e. g. the button size, location,
shape, text, text format, size and color, background color are all
changeable.

2) the only way to change the name of a form button is with VBA code, e.
g.


Sub ChangeButtonName()

activesheet.Shapes("Button1").Name = "Delete Departments Instructions"
End Sub

OTOH, the name of an ActiveX button can be changed by entering the
Designer mode and right clicking on the button and then selecting
properties
and changing the name property. The name of a form button may have spaces
in
it whereas the name of an ActiveX button may not


3) The code executed when an ActiveX button is pressed *must* be on the
code sheet for the worksheet on which the button is located, and the
routine
must have a name corresponding to the button, e. g.

Private Sub CommandButton1_Click()
MsgBox "Hello from CommandButton1"
End Sub

OTOH a form button can be given the name of the routine to execute when
the
button is pressed, and this routine can be located in any VBA module.
What's
more, the routine can even be declared private!

Am I correct in what I have stated about the 2 kinds of buttons? Which
kind
is recommended?

P.S. I have been speaking of command buttons, but as for labels, the
"Active X" kind seems better than the form kind because I can change the
text
size and color of Active X labels but can't seem to do that for form
labels.
It is possble to change text size and font and color on a form label ?


Thanks in advance


--
-regards



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 663
Default Form buttons vs. ActiveX Buttons

Hi,

Form button is used on the Userform. They don't activate themself unless a
code is associated the control and executed at run time.

However, an Activex Control can run in the design mode it selfduring the
development stage in the User Form. For example, if have a timer control, is
placed in the UserForm, they start running in the design mode.

ActiveX Control are OLE Control which works in Windows environment only.

Challa Prabhu

"GeorgeJ" wrote:

I am working on an XL 2007 project requiring command buttons on a form. When
I go into the developer tab and activate the design mode and then select
insert, I am presented with 2 options for a button - a "form" button" or an
"Active X" button. I am trying to determine the advantanges and
disadvantages of each type vs. the other. So far this is what I have come up
with...

1) Both types are flexible in appearance, e. g. the button size, location,
shape, text, text format, size and color, background color are all
changeable.

2) the only way to change the name of a form button is with VBA code, e. g.


Sub ChangeButtonName()

activesheet.Shapes("Button1").Name = "Delete Departments Instructions"
End Sub

OTOH, the name of an ActiveX button can be changed by entering the
Designer mode and right clicking on the button and then selecting properties
and changing the name property. The name of a form button may have spaces in
it whereas the name of an ActiveX button may not


3) The code executed when an ActiveX button is pressed *must* be on the
code sheet for the worksheet on which the button is located, and the routine
must have a name corresponding to the button, e. g.

Private Sub CommandButton1_Click()
MsgBox "Hello from CommandButton1"
End Sub

OTOH a form button can be given the name of the routine to execute when the
button is pressed, and this routine can be located in any VBA module. What's
more, the routine can even be declared private!

Am I correct in what I have stated about the 2 kinds of buttons? Which kind
is recommended?

P.S. I have been speaking of command buttons, but as for labels, the
"Active X" kind seems better than the form kind because I can change the text
size and color of Active X labels but can't seem to do that for form labels.
It is possble to change text size and font and color on a form label ?


Thanks in advance


--
-regards

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,365
Default Form buttons vs. ActiveX Buttons

I think you've described their similarities/differences/capabilities pretty
well, and Jim Rech and challa prabhu have added some detail to that.

I'm like Jim Rech - all things being equal, I'll use Forms controls even on
a worksheet in favor of ActiveX buttons. Mostly for their lighter 'weight' -
less system overhead used to use them. But there are times when they aren't
suitable or don't have the flexibility that comes with the ActiveX controls,
in which case I use them when required.

Think of them as similar tools that can often both be used to achieve a
goal, but sometimes one is a better fit than another. Kind of like a 9/16"
open end wrench and a 9/16" box end wrench - in most cases, either will work
to loosen/tighten a 9/16" nut, but in a tight space, the open-end may be the
better choice, or even the only choice. (and then you discover rachets! - no,
no hidden reference to some other really flexible controls, just an
observation).

"GeorgeJ" wrote:

I am working on an XL 2007 project requiring command buttons on a form. When
I go into the developer tab and activate the design mode and then select
insert, I am presented with 2 options for a button - a "form" button" or an
"Active X" button. I am trying to determine the advantanges and
disadvantages of each type vs. the other. So far this is what I have come up
with...

1) Both types are flexible in appearance, e. g. the button size, location,
shape, text, text format, size and color, background color are all
changeable.

2) the only way to change the name of a form button is with VBA code, e. g.


Sub ChangeButtonName()

activesheet.Shapes("Button1").Name = "Delete Departments Instructions"
End Sub

OTOH, the name of an ActiveX button can be changed by entering the
Designer mode and right clicking on the button and then selecting properties
and changing the name property. The name of a form button may have spaces in
it whereas the name of an ActiveX button may not


3) The code executed when an ActiveX button is pressed *must* be on the
code sheet for the worksheet on which the button is located, and the routine
must have a name corresponding to the button, e. g.

Private Sub CommandButton1_Click()
MsgBox "Hello from CommandButton1"
End Sub

OTOH a form button can be given the name of the routine to execute when the
button is pressed, and this routine can be located in any VBA module. What's
more, the routine can even be declared private!

Am I correct in what I have stated about the 2 kinds of buttons? Which kind
is recommended?

P.S. I have been speaking of command buttons, but as for labels, the
"Active X" kind seems better than the form kind because I can change the text
size and color of Active X labels but can't seem to do that for form labels.
It is possble to change text size and font and color on a form label ?


Thanks in advance


--
-regards

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
Form buttons Homer Excel Worksheet Functions 2 December 30th 06 07:39 PM
have toggle buttons but everytime print preview buttons move TinSandhu Excel Discussion (Misc queries) 1 October 11th 06 02:57 PM
form/subform with buttons BAZ Excel Worksheet Functions 0 February 9th 06 04:20 PM
I need a form with 5 buttons that correspond with values 1-5 Steven J Reddy Excel Discussion (Misc queries) 2 September 25th 05 03:09 AM
Add buttons in a form from a datasource justagirl Excel Discussion (Misc queries) 0 August 3rd 05 06:05 PM


All times are GMT +1. The time now is 11:55 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"