#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 140
Default Controls

Probably a very basic question but when placing say Buttons, Combo boxes etc
on a spreadsheet when should one use Form controls and when should one use
Control Toolbox controls.
--
with kind regards

Spike
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Controls

Not a basic question at all. Here is a QND explanation...

Control Toolbox - This is the button I use 99% of the time. It is the most
familliar to people who are familliar with coding in VB. A button is embeded
right in the sheet and the code written lands in the sheet (not in a module).
Drag a button off the control toolbox and right click on it. Select
Properties
and here you can modify the look and function of the button. There are lots
of
choices. You definitely want to change name to something like cmdMyButton
and the caption to a description of the action the button does, like "Copy
Stuff". Right click on the button again and choose view code. Now you can
write code for the button to do.

Forms Toolbar - The button from this menu is more like a picture of a
button. When you add the button you will be promted to link it to a macro. It
could be any publicly declared procedure written in a module (recorded macros
qualify here). That can be handy if you are wanting to copy sheets out of
your workbook and have no code in the sheet.

A couple of notes. I have had at least one or 2 instances where buttons from
the control toolbox causes weird things to start happening. In one instance
it caused my app to randomly crash and in the other it caused weird side
effects in other open workbooks. That is 2 instances in many years of coding.
--
HTH...

Jim Thomlinson


"Spike" wrote:

Probably a very basic question but when placing say Buttons, Combo boxes etc
on a spreadsheet when should one use Form controls and when should one use
Control Toolbox controls.
--
with kind regards

Spike

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Controls

Just to muddy the water...

I almost always use the controls from the Forms toolbar. They are less
customizable, but they also behave better when there are lots of them on the
worksheet.

And I can assign the same macro to different controls--even on different
sheets.

One of the times that I'll use controls from the Control toolbox toolbar is when
I know that I'll be copying/moving that sheet to another workbook--and that
control has code associated with it.

If I keep all the code in the worksheet module, then that code will move with
the worksheet to its new home.

Controls from the Forms toolbar that have macros assigned will still point back
to the original workbook. And usually will need to have the macros assigned to
point at the new workbook.

Spike wrote:

Probably a very basic question but when placing say Buttons, Combo boxes etc
on a spreadsheet when should one use Form controls and when should one use
Control Toolbox controls.
--
with kind regards

Spike


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 140
Default Controls

Thank you Dave much appreciated, sorry been away hence tardiness in reply

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 140
Default Controls


Thank you Jim much appreciated, sorry been away hence tardiness in reply
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
add controls stewart Excel Programming 0 September 10th 07 12:47 AM
Excel controls vs vba controls cmpcwil2[_6_] Excel Programming 3 April 19th 06 03:33 PM
ActiveX Controls vs Form Controls Alex Excel Discussion (Misc queries) 1 January 11th 06 08:46 AM
VB Controls Simon Shaw Excel Programming 2 November 18th 05 05:15 PM
Event procedures for controls added with Controls.Add John Austin[_4_] Excel Programming 1 March 9th 05 03:31 PM


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

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

About Us

"It's about Microsoft Excel"