XL5: Macro Fails If Optional Argument Uses Integer Data Type

Last reviewed: September 2, 1997
Article ID: Q112321
The information in this article applies to:
  • Microsoft Excel for Windows, version 5.0

SYMPTOM

On page 128 in some versions of the "Visual Basic User's Guide," the example that illustrates the REVERSE() function, contains the following line of code:

   Function Reverse (S As String, Optional ByVal n As Integer)

This code is incorrect. The optional argument "Optional ByVal n As Integer" is incorrect because, as is stated in the paragraphs immediately preceding the function code, all optional arguments must be of the Variant data type.

WORKAROUND

The correct line of code is the following:

   Function Reverse (S As String, Optional ByVal n As Variant)

STATUS

This problem has been corrected in versions of the "User's Guide" dated later than January 1994.


Additional query words: 5.00
Keywords : kbprg PgmOthr
Version : 5.00
Platform : WINDOWS


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: September 2, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.