I have a love-hate relationship with ActiveX controls.
Why I Hate Them
In general, I try to avoid ActiveX controls for the following reasons:
- It's an external dependency beyond your control
- They can complicate deployment (especially if you don't use an installer)
- They often generate hard-to-debug errors
- They can lead to hard crashes
- They often have inadequate documentation
- Licensing can be confusing and sometimes expensive
Why I Love Them
Despite my frustration with ActiveX controls, there are still some very good reasons to use them:
- They can provide advanced functionality
- They save development time
- They can make the impossible possible (integrating with other software and programming languages)
- They can boost performance (in some specific situations)
A Little Help From My Friends
The developer support experience varies greatly among the ActiveX controls available on the market.
The problem is that you are at the mercy of the control's developer. That control developer could be a multi-national corporation like ESRI. Or it could be Chuck from Rhode Island who retired a few years ago but never quite got around to doing anything with his 90's website that still brings in a few hundred dollars in ActiveX control sales each month.
If you need support, don't worry, ESRI's got your back (and your wallet)...but good luck with Chuck.
A Necessary Evil?
ActiveX controls are not always a good option. But sometimes they are your only option.
In short, some ActiveX controls provide functionality that is simply impossible (or sufficiently impractical) to reproduce with VBA. A few examples:
- Integrations with third-party software (ESRI GIS, etc.)
- Interacting with hardware devices (scanners, etc.)
- Advanced form controls (interactive calendars, etc.)
When to Use an ActiveX Control
When trying to decide whether to use an ActiveX control in a project, I consider a few things:
- Does it offer 32-bit and 64-bit support?
This one is critical as many ActiveX controls were written in VB6's heyday when 64-bit support was not even a consideration. Before tying yourself to any ActiveX control today, make sure it provides both 32 and 64-bit versions.
- Does it use a royalty-free license?
I don't want the headaches that come with trying to manage licensing royalties for an ActiveX control that is supposed to be making my life as a developer easier.
- Is it actively supported?
Honestly, I don't get too hung up on this one unless the control will be the centerpiece of my application. There are plenty of ActiveX controls out there that have been around for 10+ years. If they are relatively simple, chances are not much breaks on them anymore. However, if it looks like a new(-ish) control, I want to have a warm fuzzy feeling that if something breaks, someone will be around to fix it.
- Is there no other way?
If I'm writing an Access application that has to talk to some other closed-source application, my only option may be to use that company's provided ActiveX control.
Controls I've Used
Despite my frustrations, I do use ActiveX controls in several of my applications.
Here is a brief sampling of some of the ActiveX controls that I have used in my projects:
- csXImage: TWAIN scanning and simple image manipulation
- Apex Sketching: simple 2-D sketching software (like a lightweight CAD)
- ESRI ArcMap: integration with an interactive GIS map
- Barcode encoding software from USPS
Do you use ActiveX controls in your Access applications? If so, do you have any favorites? Let us know in the comments below.