Intelli Sense and Statement Completion

Both the retail version of VB and the VBA development environment make use of Microsoft's IntelliSense technology. Statement Completion not only helps to speed 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, as Figure 5-3 shows.

Option Explicit

Private Sub Coimiandl Click () dim oXLApp as excel.




tJi Adjustments

til Application

til Areas

ffl Auto Correct

tJi Auto Filter


Figure 5-3: Statement Completion

80 Chapter 5 - Automation

By adding an object reference to your project, you expose the class's type library to the VB development environment, allowing the details of its class hierarchy to be displayed as you enter your code. The main features of IntelliSense and Statement Completion are:

• Available properties, events, and methods are shown in a drop-down list when you press the dot key.

• Pressing the Ctrl key and spacebar combination when partway through an object or procedure name either completes the name or displays a list of possible names.

• Where a property or method takes an argument list, a template of the argument list is shown as a tool tip above or below the line of code. Such a template is shown in Figure 5-4.

When coding object references and calls to methods and properties, you soon find that the number of keystrokes is dramatically reduced by IntelliSense.

GetQpenFilenameJFtfeFjftef], [Filtertride^, [77fe], [ButtoriTextj, IMultiSeleit) I Figure 5-4: Microsoft IntelliSense

Was this article helpful?

0 0

Post a comment