The Microsoft Office 2000 suite is extremely popular, and is used all
over the world. It consists mainly of five applications: Access,
Excel, Outlook, PowerPoint, and Word. The applications of the Office
suite are considered horizontal applications meaning that these
applications can be employed by many different kinds of organizations.
Using the Office applications, people in a wide variety of
organizations can build professional documents, sophisticated
spreadsheets, interesting and effective online presentations, and
powerful desktop databases.
While Microsoft Office provides a wealth of functionality, more than
enough to meet the needs of many businesses, it is sometimes desirable
to add additional functionality. For this reason, the Office suite
includes a very powerful programming language, Visual Basic for
Applications, or VBA. With VBA, developers can write programs that
provide custom solutions for specific business needs.
Once your students have a solid working knowledge of Office 2000, the
natural progression is to learn to develop VBA applications. VBA is an
easy language to learn and yet it is an extremely powerful language.
What is VBA?
VBA is a complete Integrated Development Environment (IDE), which
provides all the tools needed to develop impressive and useful
applications for the Office suite.
The "V" in the VBA acronym represents the visual characteristics of
the language. VBA makes the development of Graphical User Interfaces
(GUI) a painless process with impressive results. Students will be
able to develop forms that provide all the functionality users have
become accustomed to in the Windows environment. The user can select
from a "toolbox" of visual controls to be placed on the form to
provide an attractive and useful GUI.
The "B" in the VBA acronym represents the programming language itself.
VBA is actually a subset of Visual Basic 6.0. VBA is an object-based
and event-driven programming language. Students seem to readily grasp
the concepts associated with object-based programming. After all, they
are surrounded with everyday objects in the "real world". As an
instructor, you can use those "real world" objects to explain most of
the concepts of object-based and event driven programs. Something as
simple as an office chair can provide a basis for the discussion. The
chair (object) has many characteristics (properties); color, size,
number of arms (maybe 0), casters (Yes or No), etc. The chair can
move, but not on its own. Rather, the chair must be pushed or pulled.
Or, it can be said, an "event" must "trigger" the action; the chair is
event-driven.
The "A" part of the acronym is what sets VBA apart from VB. Of course
the "A" stands for Applications. VBA programs must "live" inside an
application. Each application in the Office suite has its own set of
objects called its Object Model. VBA exposes the application objects
so that they can programmatically modify and manipulate them. The
Object Model is a hierarchy of objects. In Word, for example, the
highest level of the Object Model is the Document; whereas, in Excel,
the highest level is the Workbook. The emphasis of programming in VBA
is interaction with the application's objects.
Why use VBA?
VBA is one of the fastest growing languages in the world. There are
currently over 40 million copies of Office on desktops around the
world.
Existing Functionality: The Office suite is already a powerful set of
tools. Each application is extremely functional. VBA takes advantage
of what is already there and provides a means to build on that
functionality. There are literally hundreds of objects available to
the developer
Fast Development: The developer can quickly create applications
because the program takes advantage of what already exists in the
application and simply builds upon it.
Sharing Data Across Applications: One of the most common uses for VBA
programs is to share data. For example, you can easily use the data in
a database to create a document, an Excel chart, and a PowerPoint
presentation. All of this can be done without the user even knowing
that the various applications are being launched and used.
Lower Development Costs: The ease of development and the use of the
application make development quicker and easier. This is a natural
labor savings, which translates to lower development costs. Also, the
VBA language is included in the Office suite so there is no extra
development software to purchase.
The User Becomes Part of the Solution: Many VBA programs are developed
for users who are already very familiar with the Office applications.
In fact, many new applications grow out of requests from users who
want to do something in one of the applications but they find it
either impossible to do or rather cumbersome. They are looking for a
quicker, better way to do what they are already doing. They can guide
the developer to provide the functionality that will meet their needs.
Summary
VBA is a very powerful development tool that takes advantage of all
the existing functionality of the Office suite. The language is easy
to learn and the IDE provides a complete set of tools for development
and debugging of sophisticated applications. VBA is being used widely
and many computer-related job ads are now requesting VBA developers.
Students enjoy the challenge of extending the functionality of the
applications with which they are already very familiar. Finally,
industry is desperate for talented VBA developers. Equipping your
students with this development tool will make them very marketable.
Diffrence Between VB & VBA
Visual Basic and Visual Basic for Applications both stem from the same
language - Basic. In that way they have at least a fundamental
similarity. You will also find that the extensions to Basic that were
included to allow Visual Basic to interact with Windows are also very
much the same in Visual Basic for Applications. In fact they both have
a very similar level of Object Orientation. The way you address
objects, collections of objects and other such things, the way you
respond to events, call methods and set properties is the same across
both languages. In some cases there are slight variations in the
specific names of events or properties but in general they are almost
the same. In fact you will find even more similarity between VBA and
Visual Basic 4 than with VB3 as VB4 uses VBA as its central code
engine. This means that they are in fact the same under the covers.
The real difference in VBA is that it is embedded in some other
product (Excel, Project, Access, whatever).
I guess to sum up, skills in Visual Basic itself or in Visual Basic
for Applications are highly transferrable from one to the other. You
should find the transition from one to the other quite easy. |