Microsoft Visual Basic for Applications (VBA) is an exceptional programming language and
environment. The language has grown out of a need to have a programming language that
would allow more business-focused individuals to write programs, but equally support the
programming features that developers look for in a product. The environment is as important
as the language because of its unique features, allowing code to be quickly modified
while being debugged.
The Access Basic language in early product versions evolved into the VBA language, which
provided a cross-product language for the Microsoft Office products. This all coincided
with the revolution of an event-driven approach to programming, which was very important,
because the emphasis on being a programmer shifted from writing thousands of
lines of code to writing snippets of code in response to events. This also led to a change
of emphasis from writing large libraries of code to understanding how to manipulate the
object models in the environment—a focus which has progressed with .NET, albeit using
namespaces instead of object models.
Even with the introduction of object-oriented programming, VBA has kept pace with the
expectations of modern programming. The two products that have shaped VBA the most
are Microsoft Excel and Microsoft Access; Excel introduced VBA and originally gained VBA
programming features in advance of these becoming available within Access.
A significant strength of VBA is that it is universal to the Microsoft Office suite of programs;
all the techniques we describe in this book can be applied to varying degrees within the
other Office products. A major turning point for these products was the ability through
OLE Automation to be able to drive one product from another, and to cut and paste code
between the different environments with a minimum amount of change to the code. This
was a revolutionary feature introduced with the programming language of Access Basic,
conforming to the new VBA standard established in Excel. VBA suddenly provided the longawaited
platform for the simple integration of the Office products and building solutions
that could easily exploit the strengths of each component product in the Office suite. The
combination of Access and VBA offers an extremely productive environment within which
to construct applications.
VBA has often been criticized for its simplicity as a language when compared to languages
such as C++ and C#. Quite to the contrary, the big advantage of VBA is that this simplicity
leads to more easily maintainable and reliable code, particularly when developed by people
with a more business-focused orientation to programming. Looking toward the future, the
emphasis in modern programming has moved from the language syntax to the intricacies
of understanding the objects that the language manipulates, so the emphasis on the specific
syntax of languages is starting to blur.