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:
SYMPTOMSIn 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.
CAUSEThis 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.
STATUSMicrosoft has confirmed this to be a problem in the versions of Microsoft Excel listed at the beginning of this article.
MORE INFORMATIONThe 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.
REFERENCESFor more information about the CommandUnderlines Property, choose the Search button in the Visual Basic Reference and type:
command underlines |
|
KBCategory: kbprg
©1997 Microsoft Corporation. All rights reserved. Legal Notices. |