The information in this article applies to:
SYMPTOMSIn the programs listed at the beginning of this article, when you attempt to hide or display a command bar in a Visual Basic for Applications Sub procedure, you may receive an error message that is similar to the following: Run-time error '-2147483640 (80000008)': CAUSEThis problem occurs when you attempt to hide or display a command bar that does not support the Visible property. 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.aspTo work around this behavior, determine whether the command bar supports the Visible property before you set the property to True. The following example loops through all of the command bars and determines if each command bar supports the Visible property. If the command bar supports the property, the property is set to True without generating the error message mentioned in this article.
NOTE: In the example, an On Error statement is inserted before the For Each
loop. If you run the macro without the On Error statement, you receive the
error message mentioned in this article.
MORE INFORMATIONNot all of the command bar items support the Visible property. The command bar items that generate the error message when you use them with the Visible property are listed in the following table.
These command bars are used for context-sensitive menus and items such as
the current list of sheets in a workbook.
REFERENCES
For more information about command bars, click the Office Assistant while
in the Visual Basic Editor, type commandbars, click Search, and then
click to view "Using command bars."
Additional query words: xlvbmigrate OFF98 command bar toolbar
Keywords : kbprg |
Last Reviewed: November 9, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |