i have a macro (Makro1) that is assigned to a button in a custom toolbar (Custom1) with caption “Schutzstatus”. i want the toolbar only to be loaded with this very xls-file.
can someone help me out with the code?
i managed to customize the tooltip:
Application.CommandBars("Custom1").Controls(1).TooltipText = "Abfrage des Schutzstatus der Arten im Zwischenspeicher"
but i fail in creating the whole thing by vba..
thanks in advance,
kay
You don’t actually need to (re)create the whole toolbar on loading your XLS, but you need to display/hide it during certain navigations
1 create the toolbar
2 attach it to your XLS (view / toolbars / customize …. / attach)
3 create event procedures to show/hide your toolbar; unless you want to have a specific behaviour for different sheets, the following should be enough to care for all navigation:
Place all in the “ThisWorkbook” object – so they fire on all sheets.
4 After saving the toolbar with the XLS and testing, close the XLS – the toolbar will be still present in your application object – and delete the toolbar from there. Don’t panic, it’s coming back when you re-open your XLS file.
Hope this helps
Tschüss MikeD