WHAT IS
VBA?
Visual Basic for Applications (VBA) is the
“native” macro language of the Microsoft Office and many other applications.
It is based on the evolution of the basic programming language and very
greatly resembles Visual Basic 6.0 (usually just referred to as VB).
VBA provides many, but not all, of the features of pure VB and roughly
two-thirds of the speed. When an
application contains VBA, it is normal that many of the applications features
(objects in programmer speak) are exposed for inquiry or manipulation
(properties and methods in programmer speak).
A typical implementation of VBA within an application provides all the
objects the user needs, but not necessarily those the user wants.
VBA can also be used to create limited user defined objects, but for many
reasons this more an exception that normal practice.
VBA has several advantages over the other
available languages for automation within an application:
- The
development environment is included with the application (i.e. no other
software is required)
- The
end user can *usually* run the macro without any other software, other than
the host application. (The
hesitation is because VBA does not compile and if the macro calls for
non-standard add-ins they must also be available on the end user’s
machine.)
- No
other hardware is required (i.e. server or servers)
- An
internet connection is not required (especially within a small organization,
sneaker net or
LAN
distribution is perfectly acceptable)
- At
least for those of us fluent in English, the developed programs can be very
understandable without a deep knowledge of programming (this depends on the
programmer writing the program so that others can follow it)
While many programs support macros, it is this author’s contention that
Excel, Word, and Access are the most mature in its use.
Using Excel 2003 as the platform, this course will focus on:
- What
VBA provides (common to all supporting applications)
- Best
programming practice (common to all supporting applications)
- User
interaction (dialog boxes and custom forms)
- Manipulation
of the host application objects via VBA (properties, methods, and events)
- Excel
specific objects (Workbook, Worksheet, and Ranges)
Should this course be well attended, a follow on will be offered discussing more
advanced topics for VBA and Excel.
Course
Requirements: The student must have access to a
computer with Excel 2003 where macro security is set at medium or low.
Course Length: 10
weeks
Course Textbook:
Textbook: Writing
Excel Macros by Steve Roman, 2nd edition, published by O'Reilly. ISBN:
0596003595.