The information in this article applies to:
SYMPTOMSIn the versions of Microsoft Excel listed above, the Help topic for the Visual Basic Option Base statement contains the following information: The Option Base statement has no effect on arrays within user-defined types for which the lower bound is always 0.This information is not entirely correct. CAUSEThis statement is not true for an array within your user-defined type. For example, when you run the following code, the value 1 is returned, instead of the expected value 0 for the lower bound of the array within the user- defined type Mytype:
WORKAROUNDMicrosoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact the Microsoft fee-based consulting line at (800) 936-5200. For more information about the support options available from Microsoft, please see the following page on the World Wide Web: http://www.microsoft.com/support/supportnet/overview/overview.aspIf you want the lower bound for an array within your user-defined type to be zero, you can use any of the following methods. Method 1Use the "To" clause to explicitly define the upper and lower bounds of your array. This method overrides any Option Base settings in your module. The following is an example of using this method:
Method 2Use the Option Base statement with the value 0 by adding the following statement at the beginning of your module:
Method 3Do not use the Option Base statement at all; the default base is 0.STATUSMicrosoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem was corrected in Microsoft Excel 97 for Windows and Microsoft Excel 98 Macintosh Edition. REFERENCESFor more information about the "Option Base Statement," choose the Search button in the Visual Basic Reference (version 5.0) and type: Option Base Additional query words: 5.00a 5.00c XL5 XL7
Keywords : kbcode kbprg PgmOthr |
Last Reviewed: November 9, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |