Uderstand Object PDF
Uderstand Object PDF
method
A procedure that acts on an object.
property
A named attribute of an object. Properties define object characteristics such as size, color, and screen
location, or the state of an object, such as enabled or disabled.
A collection is an object that contains several other objects, usually, but not always, of the
same type. In Microsoft Excel, for example, the Workbooks object contains all the
open Workbook objects. In Visual Basic, the Forms collection contains all
the Form objects in an application.
procedure
A named sequence of statements executed as a unit. For example, Function, Property, and Sub are types of
procedures. A procedure name is always defined at module level. All executable code must be contained in
a procedure. Procedures can't be nested within other procedures.
VBCopy
Sub CloseFirst()
Workbooks(1).Close
End Sub
The following procedure uses a name specified as a string to identify a Form object.
VBCopy
Sub CloseForm()
Forms("MyForm.frm").Close
End Sub
You can also manipulate an entire collection of objects if the objects share
common methods. For example, the following procedure closes all open forms.