![]() |
Custom Toolbar showing in any and all workbooks opened
Created a custom toolbar for a template using the customize command. Assign
each button in the custom toolbar to a macro. Recorded the macros careful to assign them only to current Workbook. Now no matter what document I open the custom toolbar is opened also. When I goto ToolsMacroMacros there are not maros listed for any of the choices (This workbook, All Open workbooks,etc). Is there a simple way short of writing VBA to restrict this toolbar to opening only in the document for which it was created? Thanks |
Custom Toolbar showing in any and all workbooks opened
Jack, open Excel and open the workbook for which the toolbar was
created. Right-click on the toolbar and select customize. On the Toolbars tab, click Attach. Select the toolbar from the list. Click Copy. Click OK. This attaches the toolbar to the worksheet. Alt-F11 to view the code editor. If you do not have a standard module, click Insert, then Module. In the standard module, put Sub Auto_Open() Commandbars("NameOfToolbarHere").Visible=True End Sub Sub Auto_Close() Commandbars("NameOfToolbarHere").Delete End Sub Of course, put the name of your toolbar in place of NameOfToolbarHere, leaving the quotes in. Now, when you close Excel, the toolbar will be deleted from the toolbar collection. When you open the file again, the toolbar will be shown. James Jack_Feeman wrote: Created a custom toolbar for a template using the customize command. Assign each button in the custom toolbar to a macro. Recorded the macros careful to assign them only to current Workbook. Now no matter what document I open the custom toolbar is opened also. When I goto ToolsMacroMacros there are not maros listed for any of the choices (This workbook, All Open workbooks,etc). Is there a simple way short of writing VBA to restrict this toolbar to opening only in the document for which it was created? Thanks |
All times are GMT +1. The time now is 01:11 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com