What is VBA?
Visual Basic for Applications (VBA) is the universal macro language behind all Microsoft software products in general, and behind the MS Office modules (Excel, Word, Outlook, Access, Powerpoint) in particular. You also have it available in applications as MS Visio or MS Project.
Other software companies also offer VBA as their macro language, and have the same working environment (the VBA Editor) integrated into their products. Some examples are Corel (with VBA in the vector graphics program CorelDRAW), iGrafx FlowCharter of Micrografx (now part of Corel), AutoCAD and the reporting product BusinessObjects of the company with the same name (now part of SAP).
It is based upon the very popular Visual Basic 6.0 (VB6) programming language, but there are differences. It is also very similar to the VBscript scripting language, used in many browser applications and websites, but also here there are significant differences.
Although VB6 is already there since 1998 (and meanwhile has been replaced as a main programming language by fundamentally different evolutions such as Visual Basic.NET or Visual Basic 2005) VBA is still very present: in the most recent MS Office family of products, Office 2007, VBA still is the underlying macro language. So it’s not likely to disappear in the next years.
The availability of VBA in a software application can be checked by looking for a couple of common menu items, that practically always have the same name and location on the menu bar: if you have a “Macro” or “Visual Basic” option below the “Tools” menu, and a “Visual Basic Editor” sub-option beneath it, then you know you have VBA at your service!
In this tutorial, we use one of the MS Office modules as our starting basis. Most of the time this is Excel, but you might as well try the examples in Word, Outlook, Visio, Project, Access or Powerpoint. Also some tricks and how-to’s are explained about the use of VBA from within BusinessObjects, as the representative of a non-Microsoft product.