Microsoft KB Archive/184173

= XL98: ActiveMenuBar.Index Is Different from Earlier Versions =

Article ID: 184173

Article Last Modified on 9/11/2002

-

APPLIES TO


 * Microsoft Excel 98 for Macintosh

-



This article was previously published under Q184173



SYMPTOMS
In Microsoft Excel 98 Macintosh Edition, when you run a Microsoft Visual Basic for Applications macro that contains the following code MsgBox Application.ActiveMenuBar.Index the value -4167 appears in a message box.

NOTE: When you run the macro from a Visual Basic module sheet in earlier versions of Microsoft Excel, the value -4141 appears in a message box.



CAUSE
This behavior occurs when the following conditions are true:


 * You run the macro from a Microsoft Excel 98 worksheet. -or-


 * You run the macro from a module sheet in the Visual Basic Editor.

When you run a macro from the Visual Basic Editor in Microsoft Excel 98, Microsoft Excel is in "worksheet" mode, and the macro returns the value that indicates the worksheet menu bar is displayed.

The value -4167 appears because the Visual Basic Editor is a separate component of Microsoft Excel 98.



STATUS
This behavior is by design of Microsoft Excel 98.



MORE INFORMATION
In Microsoft Excel 98, a Visual Basic module sheet is part of the Visual Basic Editor; and the Visual Basic Editor is a separate component of Microsoft Excel. So, when you run the macro from the Visual Basic Editor, the macro returns the value -4167, which indicates that the worksheet menu bar is displayed.

In earlier versions of Microsoft Excel, a Visual Basic for Applications module sheet is part of a Microsoft Excel workbook.

The ActiveMenuBar property returns a CommandBar object that represents the active menu bar in the container application.

Additional query words: XL98

Keywords: kbbug kbpending KB184173

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.