No problem Marcy - See the same question posted previously and the comprehensive
answers to it:-
Hi,
what is the difference between the "button" from the Forms toolbar and the
"commandbutton" from the control toolbox?
For the commandbutton, double-clicking it will view the code associated with
it but how to access/view the code associated with the button for the Forms?
Thanks!
rgds, meow......Message 2 in thread
From: Edwin Tam (
[email protected])
Subject: Re: what is the difference?????
View this article only
Newsgroups: microsoft.public.excel.programming
Date: 2000-11-21 01:14:54 PST
The "Button" object in the Form toolbar and the "commandbutton" object in
the control toolbox are very different internally.
They have different names. They are different objects.
Commandbutton is, in the Microsoft terms, an ActiveX control. The "Button"
object is an old product in the age of OLE objects. Although ActiveX and OLE
are actually the same thing, they represent the Microsoft technologies in
different periods of time. (ActiveX is new, OLE is old.)
To refer to a normal CommandButton, like all other ActiveX control, you just
call its name. For example, for a commandbutton called "cmb1", you use:
cmb1.Visible = True
to set its visibility to TRUE.
For a "Button" on your worksheet with the same name "cmb1", you use:
Worksheets(1).Buttons("cmb1").Visible = True
Therefore, you can see the main difference is, in the old days, to call an
OLE control, you need to know :
1) The name of the object in Excel's object library ("Button");
2) The name of that particular control ("cmb1")
On the contrary, for a new ActiveX control, what you need is only:
1) The name of that particular control ("cmb1")
This makes programming much easier and saves time.
Of course, there are drawbacks. (This is for advanced users only.) The main
drawback is, in the old days, you can refer to a large amount of OLE
controls using Arrays. For example, you got 3 Buttons "cmb1", "cmb2",
"cmb3". You could set the visibility in 1 senetence:
Worksheets(1).Buttons(Array("cmb1","cmb2","cmb3")).visible = True
This is not possible in the new ActiveX controls on UserForms. (e.g. the
Commandbar control). To do the same thing, you need 3 sentences:
cmb1.Visible = True
cmb2.Visible = True
cmb3.Visible = True
Finally, you want to know how to edit a macro assigned to a Button.
Just right-click a Button, choose "Assign Macro". There, you can assign
macros to the button or edit a particular macro, by clicking the "Edit"
button.
Regards,
Edwin Tam
http://users.vol.net/edwintam/EPT.HTM
Hi,
what is the difference between the "button" from the Forms toolbar and the
"commandbutton" from the control toolbox?
For the commandbutton, double-clicking it will view the code associated with
it but how to access/view the code associated with the button for the Forms?
Thanks!
rgds, meow......
Message 3 in thread
From: Tom Ogilvy (
[email protected])
Subject: Re: what is the difference?????
View this article only
Newsgroups: microsoft.public.excel.programming
Date: 2000-11-21 05:13:39 PST
Here is some additional information:
For Controls from the Controls Toolbox Toolbar:
http://support.microsoft.com/support/kb/articles/Q168/0/67.ASP
XL97: WE1163: "Visual Basic Examples for Controlling UserForms"
For Controls from teh Controls Toolbox Toolbar on a Worksheet
http://www.microsoft.com/ExcelDev/Articles/activexl.htm
Using ActiveX Controls on a Microsoft Excel Worksheet
http://www.microsoft.com/ExcelDev/Articles/exsxsc10.htm
Using Dialog Box Controls on a Worksheet
For Controls from the Forms Toolbar:
http://support.microsoft.com/support/kb/articles/Q130/3/72.asp
XL: Sample Code for Controlling Dialog Boxes (WE1162)
Regards,
Tom Ogilvy
meow said:
Hi,
what is the difference between the "button" from the Forms toolbar and the
"commandbutton" from the control toolbox?
For the commandbutton, double-clicking it will view the code associated with
it but how to access/view the code associated with the button for the Forms?
Thanks!
rgds, meow......
--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL 00/02/03
----------------------------------------------------------------------------
It's easier to beg forgiveness than ask permission

----------------------------------------------------------------------------
Marcy said:
One more perhaps "newbie" question:
What is the difference between the FORMS toolbar and the Control Toolbox? Are
there certain instances that I would use one over the other and why?