Microsoft KB Archive/120112

From BetaArchive Wiki

Microsoft Knowledge Base

XL5: CommandUnderlines Property Incorrectly Set to xlOff

Last reviewed: September 13, 1996
Article ID: Q120112

The information in this article applies to:

  • Microsoft Excel for Windows, versions 5.0, 5.0c
  • Microsoft Excel for Windows 95, version 7.0
  • Microsoft Excel for the Macintosh, version 5.0

SYMPTOMS

In Microsoft Excel, when you use a Visual Basic procedure to set the value of the CommandUnderlines property to xlOff, and you then read the value of the property, the value returned is xlOff, instead of xlOn. This behavior contradicts the help topic for the CommandUnderlines property in the Visual Basic Reference that indicates that the CommandUnderlines property always returns xlOn.

CAUSE

This behavior occurs when you run a procedure such as the following to set and then return the CommandUnderlines property:

   Sub Test()
      Application.CommandUnderlines = xlOff
      MsgBox Application.CommandUnderlines
   End Sub

When you run this procedure in Microsoft Excel version 5.0, a dialog box appears with the value -4146, the value of the Microsoft Excel constant xlOff, instead of the value 1 for the constant xlOn as expected.

In Microsoft Excel versions 5.0c and 7.0, the value displayed is -4105, the value of the Microsoft Excel constant xlAutomatic.

STATUS

Microsoft has confirmed this to be a problem in the versions of Microsoft Excel listed at the beginning of this article.

MORE INFORMATION

The CommandUnderlines property returns or sets the state of the command underlines in Microsoft Excel 5.0 for the Macintosh. If you set the property to the value xlOn, command underlines are turned on. The Visual Basic reference states that in Microsoft Excel for Windows, reading this property always returns xlOn, and setting this property to anything but xlOn is an error. However, you do not receive an error when you set this property to a value of xlOff.

REFERENCES

For more information about the CommandUnderlines Property, choose the Search button in the Visual Basic Reference and type:

    command underlines

KBCategory: kbprg

KBSubcategory:

Additional reference words: 5.00 5.00c 7.00



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 13, 1996
©1997 Microsoft Corporation. All rights reserved. Legal Notices.