Visual Basic for Applications is a powerful technology that lets you add programmability to your application.

Why VBA?

VBA is an attractive alternative to the present PowerTerm scripting language(PSL). The main disadvantage with PSL was that editing was conducted in Notepad that was not comfortable to work with. PSL was unique to PowerTerm and therefore oneís previous programming knowledge could not be drawn upon to write a script. VBA is approaching acceptance as the industry standard. Visual Basic for Applications is common to many programming applications, including Microsoft Office 97 products. The programming knowledge acquired in any of these products will be immediately applicable to any other product that uses VBA. If you already have an application installed that uses VBA, PowerTerm Pro uses that component.

What Can You Do with VBA?

Create custom dialog boxes and forms

Integrate with Internet and intranet solutions

Create instances of OLE (ActiveX) objects within your code

Create classes (reusable custom software objects)

Store and retrieve data from the Windows registry

Detect and handle errors

Incorporate ActiveX controls into the application interface

Pass data between VBA-enabled application with a minimum of programming and fuss

Drive a second VBA-enabled application from within a first VBA-enabled application

Control the Office application; in theory, 100% of the functionality of Office products is exposed as objects/properties/methods, which means that, with occasional exceptions, you can do almost anything programmatically from the applications interface.

Automation is the key technology that makes individual Microsoft Office applications programmable. This technology allows a developer to use VBA code to create and control software objects exposed by any application, dynamic-link (DLL), or ActiveX control, which supports the appropriate programmatic interfaces.

The key to controlling an OLE automation application is a firm understanding of the applicationís object model. The object model is a hierarchy of objects that the application exposes. The application also exposes the objectís methods and properties with which the user works. It acts to describe the application to you, the developer. Each applicationís object model is different, and the amount of control you have over the application varies accordingly.

VBA editor

PowerTerm Pro enables you to write VBA scripts which can access and manipulate PowerTerm Pro objects and attributes.

Features

IntelliSense™ natural-language technology makes it easier for users to finish their tasks. Previously, a user had to guess the technical description of a task in order to get help for it.

Statement Completion not only helps to speed up the development of VB applications, but it acts as a guide leading you through the objectís hierarchy as you are coding by displaying only those objects, methods, properties, and events that are available for the code you are currently writing.

Debugging is accomplished with minimum of effort assisting the programmer with the required syntax.

By adding an object reference to your project, you expose the classís type library to the VBA environment, allowing the details of its class hierarchy to be displayed as you enter your code. By default, PowerTerm Pro is referenced by your project. You can confirm this by selecting References from the Tools menu.

The Visual Basic for Applications programming language is common across numerous enterprise applications. In addition to PowerTerm Pro, you can use VBA in Word, Excel, Access, PowerPoint and Outlook. Once you learn it, you can apply it to any of these. However, to work with an application, you need to learn about the objects it contains. In Word, you deal with documents, paragraphs and words. In Excel, you deal with workbooks, worksheets and ranges. In Access, you deal with databases, recordesets and fields. In PowerTerm Pro, you deal with Application, Session and Setup. Each application mentioned above has a clearly defined set of objects that are arranged according to the relationships between them This structure is referred to as the applicationís Object Model. The PowerTerm Pro Object Model is shown below:

In order to view the Object Model, open the Object Browser in the VBA Editor which displays the objects that are used in the application, their properties and methods which are the means in which the user can interact with the application PowerTerm Pro. The Object Browser is also helpful in viewing the objects of other applications with VBA incorporated in them.