Calling Methods

After you have created an object, you can call the methods exposed by it. A method is a function or action that an object can perform. For example, the Microsoft Excel Workbooks class lists methods that could be performed on specific workbook objects.

The syntax for calling a method in ATEasy is:

Object.Method ([param1[,...]])

The second line of the code sample shown below contains a call to a method:

xlapp=CreateObject("Excel.Application")

xlapp.Workbooks.Add()

This test code uses the xlapp variable, which was previously declared as type Excel.Application. This code starts the Excel application, sets the application to be visible and defines the caption on the Excel window. The last line of the code adds an instance of an Excel workbook by calling the Add method of the Workbooks object.