Add a Toolbar
As I discussed in Chapter 19, toolbars can be attached to a file. If you attach a toolbar to an add-in, it will become available whenever the add-in is loaded. The only time you need to create a toolbar in code is when it contains dynamically created controls like those demonstrated by the CodeToolbar sample.
I created that sample for you in Chapter 19 using the BuildCodeToolbar procedure; and I showed how to delete the toolbar in Chapter 19 using the DeleteCodeToolbar procedure. See the sample workbook, or turn back to Chapter 19 to see those examples. I use both those procedures in the following section, which demonstrates how to dynamically update the toolbar when the user activates a new workbook.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access