We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x
Private

Which is better : Form Controls, ActiveX Controls, Shapes

Medium Priority
37 Views
Last Modified: 2020-06-04
Hi Experts,

I am not able to fully understand the difference between running macros via
Form Controls
ActiveX Controls
Shapes (assigned with macros)

Is there any ranking in terms of usefulness, long life and risk of corruption !
Comment
Watch Question

David Johnson, CDSimple Geek from the '70s
CERTIFIED EXPERT
Distinguished Expert 2019

Commented:
Active-X IMO is something I would avoid using for the long term. It is on its way out.
Martin LissSocial distance - Don't touch your face - Wash your hands for 20 seconds
CERTIFIED EXPERT
Most Valuable Expert 2017
Distinguished Expert 2018

Commented:
It depends on where they are used. If we are talking about Excel then the use of ActiveX controls on worksheets should be avoided because they were not designed for that and in some cases there may be problems using them. Form controls have their own problems in that IMO some of them are poorly designed.

You can avoid problems with using ActiveX comboboxes (and probably others as well) on a worksheet using the technique that I describe in my The magical floating ActiveX control article.
Mechanical Engineer
CERTIFIED EXPERT
Most Valuable Expert 2013
Top Expert 2013
Commented:
Unlock this solution with a free trial preview.
(No credit card required)
Get Preview
Kanwaljit Singh DhunnaSelf Employed

Author

Commented:
@ David, Thanks Sir !

@ Martin, Thanks Sir !
they were not designed for that  
For what purpose they were designed ?
I will definitely go through the article

@ Byundt, Thanks Brad !
Detailed explanation appreciated !

What I concluded from all the comments is that
1. Stay away from ActiveX Controls.
2. Use Form Controls and preferably use Shapes wherever possible. (Tried Shapes, Charming !)

Is there any other way to call macro, other than using Activex / Forms / Shapes / Alt+F ?

Martin LissSocial distance - Don't touch your face - Wash your hands for 20 seconds
CERTIFIED EXPERT
Most Valuable Expert 2017
Distinguished Expert 2018

Commented:
For what purpose they were designed ?
For use on Userforms.
Kanwaljit Singh DhunnaSelf Employed

Author

Commented:
Okay. Got it. That means, if someone is to use ActiveX controls, do it through User Forms !!
Martin LissSocial distance - Don't touch your face - Wash your hands for 20 seconds
CERTIFIED EXPERT
Most Valuable Expert 2017
Distinguished Expert 2018

Commented:
Is there any other way to call macro...

Press Alt+F8 to open the "Macro" dialog window. Select a macro, click ‘Options…’,  hold down the Shift key and type the letter A (or any other letter) and click ‘OK’. Then anytime you want to run the macro press Ctrl+Shift+A.
Martin LissSocial distance - Don't touch your face - Wash your hands for 20 seconds
CERTIFIED EXPERT
Most Valuable Expert 2017
Distinguished Expert 2018

Commented:
Got it. That means, if someone is to use ActiveX controls, do it through User Forms !!
That's true but it's kind of backwards since the only controls that can be used in userforms are ActiveX.
byundtMechanical Engineer
CERTIFIED EXPERT
Most Valuable Expert 2013
Top Expert 2013

Commented:
You can also call a macro by triggering one of the events of a worksheet, chart sheet or workbook. You will see some of these events listed in the worksheet or ThisWorkbook code window. The great thing about using events to trigger macros is that everything occurs automatically without the user even thinking about it.

Useful events can appear in non-obvious places when you create a class module and declare it as With Events. The late Excel MVP Chip Pearson goes over how to set those up in his webpage http://www.cpearson.com/excel/Events.aspx Of particular note is the fact that you may take advantage of MouseDown and MouseUp and MouseMove events in an embedded chart on a worksheet. I have even placed an empty and invisible embedded chart over worksheet cells to take advantage of the MouseDown and MouseMove events.
Kanwaljit Singh DhunnaSelf Employed

Author

Commented:
Thanks Brad !

I am shocked to hear that Chip Pearson is no more !!!
I am in love with that person ! What a content on the site ! May the Soul Rest in peace !!

What I understood from yours comment is that we can create customized events to trigger in special scenarios !
Am I correct ?
byundtMechanical Engineer
CERTIFIED EXPERT
Most Valuable Expert 2013
Top Expert 2013

Commented:
Microsoft defined a number of different things the user might do as events. Microsoft then gave you the ability to write VBA code that is triggered by those events. The event sub declaration (statement that defines the sub name and its parameters) is fixed by Microsoft. You may then customize the response to the event by putting your own VBA code inside them.
Kanwaljit Singh DhunnaSelf Employed

Author

Commented:
Thanks a Lot to all of You !
Regards
Kanwaljit
Martin LissSocial distance - Don't touch your face - Wash your hands for 20 seconds
CERTIFIED EXPERT
Most Valuable Expert 2017
Distinguished Expert 2018

Commented:
You’re welcome and I’m glad I was able to help.

If you expand the “Full Biography" section of my profile you’ll find links to some articles I’ve written that may interest you.

Marty - Microsoft MVP 2009 to 2017
              Experts Exchange Most Valuable Expert (MVE) 2015, 2017
              Experts Exchange Top Expert Visual Basic Classic 2012 to 2019
              Experts Exchange Top Expert VBA 2018, 2019
              Experts Exchange Distinguished Expert in Excel 2018
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a free trial preview!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.