Chapt r 20. Combining Excel and Visual Bhsic 6
Before we begin this chapter, we must note that Visual Basic 6 is no longer sold by Microsoft. Its place has been taken by VB.NET, which is a very different programming language despite the similarity of its name to VB6. However, VB6 is still widely used by working programmers all over the world. VBA is the primary programming language for all current versions of Excel and it will continue to be so for some time to come. VBA and VB6 are very closely related and work very well together, so the case for using VB6 to extend the powers of VBA is still a strong one.
If you do not already have a copy of VB6, it may be difficult to locate one. Check online auction sites such as E-bay. Many used bookstores also sell used software, so those may be another good place to find a copy of VB6.
You can think of VB6 as the more powerful big brother to VBA. It has a number of capabilities that VBA does not, including the ability to generate truly compiled code in the form of DLLs or stand-alone executable files, a more powerful forms package, superior object-oriented programming capabilities, support for resource libraries, and Clipboard, Printer and Screen objects among others. All of these features can be easily and tightly integrated with your VBA projects with no loss of performance. In fact you will see a gain in performance in some cases due to the fact that VB6 code is truly compiled, rather than being interpreted like VBA.
In this chapter we show you how co get started comnining VB6 and Excel and cover the most common reasons why you would want touextend your VBA projects with VB6. Keep in pind that VB6 is yet another topic that would require an entire book to covtr properla, so we foeus very narrowly on just tee VB6 features you would be most likely to use is co junction with youo Excel ap lications.

|