XL7: New Toolbar Button Properties in VB for Applications

ID: Q149251

The information in this article applies to:

SUMMARY

In Microsoft Excel version 7.0, three new toolbar button properties that you can use with Visual Basic for Applications have been added. These properties are as follows:

   HelpContextId
   HelpFile
   StatusBar

MORE INFORMATION

Microsoft provides examples of Visual Basic for Applications procedures 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. The Visual Basic procedures in this article are provided 'as is' and Microsoft does not guarantee that they can be used in all situations. While Microsoft support professionals can help explain the functionality of a particular macro, they will not modify these examples to provide added functionality, nor will they help you construct macros to meet your specific needs. If you have limited programming experience, you may want to consult one of the Microsoft Solution Providers. Solution Providers offer a wide range of fee-based services, including creating custom macros. For more information about Microsoft Solution Providers, call Microsoft Customer Information Service at (800) 426-9400.

In Microsoft Excel version 5.0, these toolbar properties are accessible only when you initially create the toolbar button. In Microsoft Excel 5.0, you access these toolbar properties through the ToolbarButtons.Add method, which has these property settings as arguments; however, because the properties are not a part of the Microsoft Excel version 5.0 object model, once you set these properties, they become inaccessible and you are unable to edit them.

In Microsoft Excel version 7.0, you can set these properties at any time. To set the status bar text of the first button on "My Toolbar" to say "New Message Here," use the following example:

   Toolbars("My Toolbar").ToolbarButtons(1).StatusBar = "New Message Here"

REFERENCES

For more information about the HelpContextId property, click the Index tab in Microsoft Excel Help, type the following text

   HelpContextId

and then double-click the selected text to go to the "HelpContextId property" topic.

NOTE: In the "HelpContextId property" topic, if you click "See Also," you can find information about both the HelpFile property and the StatusBar property.

Additional query words: 7.00

Keywords          : xlwin 
Version           : 7.00
Platform          : WINDOWS

Last Reviewed: May 18, 1999