PDA

View Full Version : Solved: Form Controls Vs Active X Controls



Aussiebear
01-13-2007, 02:53 PM
Can someone please summarise when it's the right time to use either a form control or an active x Control given that a number of these tools are available as either.

Examples;

Command Buttons, Combo box, Check Boxes, Spin buttons, List box, Radio buttons and scroll bars.

Ted

Norie
01-13-2007, 03:20 PM
Ted

That's quite a broad topic and I think it mainly depends on what you are actually doing.

I prefer to use controls from the Control Toolbox toolbar as, in my opinion,
they are easier to use/manipulate with code.

They are also more akin to userform controls which I'm more used to.:)

Aussiebear
01-13-2007, 05:01 PM
OK then lets cut it down to just the use of command buttons. Why would one be more advantagous than the other?

Bob Phillips
01-13-2007, 06:23 PM
My rule of thumb is that it is probably better to use forms controls because they are better integrated in Excel. Only use control toolbox controls if you want something that forms controls cannot do, such as background colour.

Having said that, I think that any controls on the worksheet are intrusive, and much prefer toolbar buttons, or menu items.

Aussiebear
01-13-2007, 06:53 PM
Using either will still require the user to click enable macro's if it's not a "Trusted Source" workbook?

Bob Phillips
01-14-2007, 04:40 AM
If you have code associated with them, yes.

JonPeltier
01-14-2007, 08:15 PM
I'm with el xld. I prefer using the Forms controls, as they seem to interact more smoothly with Excel, and cause fewer problems. Only Forms controls can be used on a chart sheet.

Controls Toolbox controls can be funky at times, and have been blamed for worksheet corruption. However, they provide more control over formatting. Also they update continuously rather than when the mouse is released. For example, a Controls scrollbar linked to a cell will update the cell continuously as the user moves the little rectangle along the scrollbar's length, while the Forms slider only updates the cell when the user releases the rectangle.

Aussiebear
01-15-2007, 12:22 AM
Thanks Jon. I notice that in the beta version of 2007 both versions are offerred when you click on Developer then insert controls. Could it be that the intergration is better in 2007 or should one simply ignore them until on gains some sort of proficency in coding?

Ted

JonPeltier
01-15-2007, 08:57 AM
They are also both offered in the RTM version. From what I've seen in limited trials, neither is as well integrated as before. The forms version seem to work well enough in the Excel window, but some VBA functiosn are not working right. The controls toolbox version were very unstable in the beta (crashing and disappearing), and I've yet to try them in the RTM.

Bob Phillips
01-15-2007, 09:20 AM
They seem to work okay in the RTM in the limited testing that I have done.

However, like Jon, I don't believe that they are any better integrated, I think that the fact that they are both grouped in the Developer tab reflects the desired aim of grouping functionally similar things in the tabs, to better facilitate finding and using these functions.

matthewspatrick
01-15-2007, 10:43 AM
Having said that, I think that any controls on the worksheet are intrusive, and much prefer toolbar buttons, or menu items.

:soupbox:

I am 100% with Bob on that comment. I HATE seeing controls (Forms or AciveX) on worksheets. Loathe. Despise.

I hate the way they look, and I also hate the ways they sometimes misbehave. I will only use them when a client insists, and then only after I try 5 or 6 times to talk him/her out of it.

I usually make things work by manipulating the menu, and I much prefer calling UserForms whenever I really need to show a control to a user.

Aussiebear
01-16-2007, 03:05 AM
Hmmm... well that about sells for me them. Form controls only.

JonPeltier
01-16-2007, 07:40 AM
I HATE seeing controls (Forms or AciveX) on worksheets. Loathe. Despise.

I don't like them on a sheet that requires scrolling around, and I agree that often a userform or menu/commandbar approach is superior. But often I make one-screen displays (dashboards?) for clients, and provide sliders, option buttons, checkboxes, and buttons to help them adjust and tweal their models. They can be a PITA, but like anything, when used smartly and not to excess, they can add value to a project.

johnske
01-16-2007, 02:31 PM
Yes, there are sometimes valid reasons for buttons etc on a spreadsheet.

Another advantage with forms buttons is that when a printout is required for a sheet with forms buttons on it, Excel automatically excludes those buttons from the printout. This is not so with Controls buttons, if you don't want them printed you have to set their Visible property = to false before printing :)

JonPeltier
01-16-2007, 02:55 PM
if you don't want them printed you have to set their Visible property = to false before printing
It's easier than that. In design mode, select the control, press Ctrl+1 to format it. On the Properties tab, uncheck the Print Object checkbox.

johnske
01-16-2007, 03:09 PM
Well ... I've just never noticed that property - thanx Jon :)