Toolbars and MenusI added a custom button to a toolbar, but the tool tip continues to display "Custom." How can I get it to show something more meaningful? The tool tip for a toolbar button is actually the Name property of the button. The only way to change the Name property is by using VBA macro code. Here's an example that will display "Process Data" as a tool tip for the first button on a toolbar named MyBar: Toolbars("MyBar").ToolbarButtons(1).Name = "Process Data"
When creating custom menus and toolbar buttons, how do you set the status bar line to display descriptive information about the selected item? In Excel 95, ToolbarButton objects have a StatusBar property. You can use this to set the status bar text. If you're using Excel 5 you must use the Tools Macro command. Select the name of the macro assigned to the toolbar button or menu item, and then click the Options button. In the Macro Options dialog box, enter the text into the text box labeled Status Bar Text. To assign the status bar text with VBA code, use a statement such as:Application.MacroOptions _ Macro:="myMacro", StatusBar:= "My Text" I have a macro attached to a toolbar button. Is it possible to have the macro perform a different action if the user presses Shift while the button is clicked? Yes, but you have to use a Windows API call to do it. How can you change the name of a custom toolbar? For a toolbar object, the Name property is read-only. There is no way to change the name of a custom toolbar. However, my Power Utility Pak includes a utility to do so. Can a toolbar contain more than one row of buttons? Yes and no. You can change the size and dimensions of free-floating toolbars and make them any number of rows and columns you want. But if you plan to dock the toolbar on an edge of the window it can have only one row or column of toolbar buttons. I like to dock my toolbars to the left or right edge of the screen. Some toolbars just refuse to be docked there. What gives? If the toolbar contains nonstandard toolbar buttons, they can't be docked on the right or left. Nonstandard toolbar buttons include Font, Font Size, Zoom Control, Color, and a few others. Is it better to use Excel's menu editor, or should I modify menus using VBA code? It depends on what you're doing. For simple menu modification, the menu editor works fine. However, there are limitations as to what you can do with the menu editor. If you need to do anything fancy - such as add checkmarks or disable menu items - you'll need to use VBA. I wrote some VBA code to modify Excel's menus. When I attempted to modify these menus with the menu editor, my changes did not appear. Why is that? The menu editor works completely independently of menu modifications that you make with VBA. Therefore, it's best to use one technique or the other exclusively. I used the menu editor to modify the menus in two workbooks. When both of these workbooks are open, the menus are all messed up. Having more than one workbook open that uses custom menus can cause unpredictable results. To be on the safe side, make sure that only one such workbook is open at a time. |