Developing COM Add-ins with Phillip Stiefel
Want to extend Access's development environment with powerful custom tools? COM add-ins might be just what you need.
In this Access Europe presentation, former MVP Philipp Stiefel demonstrates how to create COM add-ins for Microsoft Access using modern development tools. Drawing from his experience building commercial add-ins like Ivercy and Find & Replace, Philipp walks through the fundamentals of COM interfaces, implementation patterns, and best practices for add-in development.
Whether you're looking to enhance your development workflow or create tools for other Access developers, this comprehensive overview provides practical insights into building professional COM add-ins.
Why Use COM Add-ins?
Key Benefits
- Enhance the Access development environment with custom tools
- Leverage powerful programming environments beyond VBA
- Seamlessly integrate into the Access UI
- Optionally extend functionality to other Office applications
- Access APIs not available through standard VBA declarations
Primary Use Cases
- Developer productivity tools
- Enhanced development environment features
- Cross-Office application integration
- Complex functionality requiring compiled code
Technical Foundation
COM Basics
- Binary interface standard built into Windows
- Programming language independent
- Foundation for Office object libraries
- Requires compiled objects (DLLs/EXEs)
- Cannot be implemented directly in VBA
Required Interfaces
- IDTExtensibility2 - Core add-in interface
- IRibbonExtensibility - Optional ribbon support
- Custom interfaces for specific functionality
Implementation Details
Essential Methods
- OnConnection - Called when add-in loads
- OnDisconnection - Called during shutdown
- OnStartupComplete - After host app initializes
- GetCustomUI - Returns ribbon XML (if implementing ribbon)
Registration Requirements
- COM class registration in Windows Registry
- Add-in registration in Office application
- Can be per-user (HKCU) or machine-wide (HKLM)
- Registration scripts simplify deployment
Development Best Practices
Environment Setup
- Use modern development tools (Visual Studio, TwinBASIC)
- Reference required type libraries
- Consider late binding for Office automation
- Implement proper debugging support
Design Considerations
- Plan for both 32-bit and 64-bit compatibility
- Handle loading/unloading gracefully
- Implement proper error handling
- Consider cross-Office compatibility if needed
Debugging and Testing
Key Tips
- Use "Attach to Process" for live debugging
- Add diagnostic message boxes during development
- Test with other add-ins disabled
- Verify registration settings
Conclusion
COM add-ins provide a powerful way to extend Access's development environment beyond what's possible with traditional Access add-ins. While the initial setup requires more technical knowledge than VBA-based solutions, the benefits of compiled code, advanced APIs, and cross-Office compatibility make them invaluable for serious Access developers.
Recording
The full recording is available on YouTube:
Join Live!
Want to get even more out of these presentations? Join the live Access User Group events! The next upcoming events are listed on the AUG Event Calendar.
Attending live gives you the opportunity to:
- Interact directly with presenters during Q&A sessions
- Network with other Access developers
- Share your own experiences and challenges
- Get immediate answers to your specific questions
- Participate in group discussions
With multiple user groups across different time zones (and languages!), you're sure to find a meeting time that works for your schedule.
See Also
Acknowledgements
- Base cover image generated by FLUX-schnell
- Initial draft generated by Claude-3.5-Sonnet