O'Reilly logo

Programming Excel with VBA and .NET by Steve Saunders, Jeff Webb

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 23. Integrating DLLs and COM

VBA and Excel provide an extensive set of objects, properties, and methods that you can use to perform almost any imaginable task. However, in some areas those members don’t do exactly what you need or don’t do the task as simply as you might like. In those cases, you can extend your set of programming tools by bringing in functions from dynamic link libraries (DLLs) and objects from other Common Object Model (COM) applications.

Warning

DLLs and COM are Windows-only features. They aren’t present on the Macintosh.

DLLs grant you access to the low-level functions used by Windows itself. Just about any task that Windows performs can be accomplished in your Visual Basic code by accessing a system DLL.

COM is for higher-level tasks. Excel implements COM as the technology used to expose its objects, properties, and methods to Visual Basic. All of the other Office applications and many non-Microsoft applications implement COM, too. You can use any of those applications from Excel Visual Basic.

Tip

Code used in this chapter and additional samples are available in ch23.xls.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required