The information in this article applies to:
SYMPTOMSWhen you attempt to hide or show a CommandBar object in a Visual Basic for Applications macro you may receive the following error message:
CAUSEThis problem occurs if you attempt to hide or show a command bar to which the Visible property does not apply. 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 a Microsoft Certified Solution Provider
or the Microsoft fee-based consulting line at (800) 936-5200. For more information about
Microsoft Certified Solution Providers, please see the following page on the World Wide Web:
http://www.microsoft.com/mcsp/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.aspThe following example will loop through all of the command bars and display the command bar name in a message box, without generating the error message mentioned earlier. NOTE: The "MsgBox ComBar.Name" line in the macro below is for demonstration purposes. There are over 80 command bars that use the Visible property, so you will receive over 80 message boxes. Remove this line if the macro is taking too long to run.
An On Error statement was inserted before the For Each loop. If you run the macro without the On Error statement, you will receive the error message mentioned earlier.
MORE INFORMATIONNot all of the CommandBar items support the Visible property. The following is a list of CommandBar items that are known to generate the error message mentioned earlier, when used with the Visible property.
These command bars are used for shortcut menus and items such as the current list of sheets in a workbook.
Additional query words: xlvbmigrate XL2000
Keywords : kberrmsg kbprg kbdta kbdtacode OffVBA KbVBA |
Last Reviewed: July 20, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |