WD97: Troubleshooting Variables and Data TypesLast reviewed: February 11, 1998Article ID: Q161923 |
The information in this article applies to:
SUMMARYThis article offers suggestions for using variables and data types in Microsoft Visual Basic for Applications in Microsoft Office 97.
MORE INFORMATIONWhen declaring variables, the default data type is Variant. Programmers should ideally specify specific data types and not use the Variant data types. Variant data types consume more memory, do not offer the same performance as specific data types, and can promote errors in programming logic. Make sure variables are properly declared. Consider the following example:
Dim oVar1, oVar2 As ObjectThis syntax may appear to be declaring two Object variables, but in this case oVar1 is being implicitly declared as a Variant (the default data type) and oVar2 is being explicitly declared as an Object. The following code will produce two Object variables:
Dim oVar1 As Object Dim oVar2 As ObjectFor more information about dimensioning variables, click the Office Assistant in the Visual Basic for Applications Editor, type "Dim," click Search, and then click to view "Dim Statement."
|
Additional query words: tshoot declaration declaring dimension Byte
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |