The information in this article applies to:
SYMPTOMS
After you press the PERIOD key when you type some object keywords in a
Microsoft Visual Basic for Applications Code window, the list
that contains the properties and methods available for the object (Auto
List Members) may not appear.
CAUSEThe behavior may occur if the following conditions are true:
-or- -or- RESOLUTION
To resolve this problem, you must declare a variable with the specific
object type. When you type the variable name and press the PERIOD key, the
correct list of methods and properties appears.
This procedure is referred to as early binding.
MORE INFORMATIONWhen you press the PERIOD key after you type a Visual Basic keyword, you receive a list of items (Auto List Members) that help you complete the Visual Basic code. Although they are Visual Basic keywords, some items do not show in the list. Examples are listed later in this article. Example 1: Items That Can Refer to Multiple ObjectsBecause they can refer to a worksheet or a chart sheet object, the use of Sheets(1) or ActiveSheet in Microsoft Excel will not display Auto List Members. The exact object type is ambiguous, and no list is displayed.NOTE: If you press the PERIOD key after typing ActiveWorkbook or ActiveChart, this problem does not occur, because both keywords have associated properties and methods. Example 2: Items That Resolve to the Object TypeIn Microsoft Excel, Worksheets(1) will not display the Auto List Members, because you can use the following syntax.Worksheets(Array("Sheet1", "Sheet2"))and return another Worksheets collection. The context in which Worksheets(1) is used in Visual Basic for Applications is ambiguous. Example 3: Variant ObjectsIf you use the Set statement to assign an object to a variable without using the Dim statement first to declare the variable to be an object, the Auto List Members feature will not work for that variable.Auto List Members feature will not work with the following line of code:
However if the following line of code is inserted before the earlier code,
the Auto List Members feature will work:
To turn the Auto List Members feature on or off, follow these steps:
REFERENCES
"Mastering Microsoft Office 97 Development," 97, Chapter 5, "Using Object
Variables"
Q138138 INFO: Late, ID, Early Binding Types Possible in VB for Apps Additional query words: XL97
Keywords : kbdta xlvbainfo |
Last Reviewed: November 8, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |