Page 9 - Open Soource Technologies 304.indd
P. 9
Unit 1: The Integrated Development Environment
Visual Basic 6.0 under Windows 95, recognizing such applications will not operate in 16 bit
environments.
1.2.1 Structure of a Visual Basic Application
Project (.VBP, Mak)
Form 1 (.FRM) Form 2 (.FRM) Form 3 (.FRM) Module 1 (.BAS)
Control 1 Control 1 Control 1
Control 2 Control 2 Control 2
Control 3 Control 3 Control 3
Figure 1.2: Structure of a Visual Basic Application.
1.3 Application OF VB
Visual Basic Applications (VBA): This is an implementation of Microsoft’s event-driven
programming language, Visual Basic 6 and its associated integrated development environment
(IDE), which are built into most Microsoft Office applications. VBA enables developers to build
user defined functions, automate processes and access Win 32 and other low-level functionality
through DLLs. It was also built into office applications apart from version 2008 for Apple’s Mac
OS X, other Microsoft applications such as Microsoft MapPoint and Microsoft Visio as well as
being at least partially implemented in some other applications such as AutoCAD, Word Perfect
and ArcGIS. It supersedes and expands on the capabilities of earlier application-specific macro
programming languages such as Word’s Word Basic. It can be used to control many aspects of
the host application, including manipulating user interface features, such as menus and toolbars,
and working with custom user forms or dialog boxes. VBA can also be used to create import
and export filters for various file formats, such as ODF.
As its name suggests, VBA is closely related to Visual Basic and uses the Visual Basic Runtime,
but can normally only run code within a host application rather than as a standalone application.
It can, however, be used to control one application from another using OLE Automation. For
example, it is used automatically to create a Word report from Excel data, in turn automatically
collected by Excel from Polled observation sensors. The VBA IDE is reached from within an office
document by pressing the key sequence Alt+F11.
VBA is functionally rich and flexible but it does have some important limitations, such as
restricted support for function pointers which are used as callback functions in the Windows API.
It has the ability to use (but not create) (Active X/COM) DLLs, and later versions add support
for class modules.
1.4 The Integrated Development Environment
The Visual Basic IDE appears in Figure, and as a Visual Basic programmer, this is where you’ll
spend most of your programming time. If you are not already familiar with the parts of the IDE,
you will be in time.
LOVELY PROFESSIONAL UNIVERSITY 3