Save and Distribute Menus
When you close Excel, any menu changes you made are automatically saved in an .xlb file. The filename and location varies based on the version of Excel. Versions 2000, XP, and 2003 are Excel9.xlb, Excel10.xlb, and Excel11.xlb, respectively. On Windows XP, the files are stored in the %UserProfile%\Application Data\Microsoft\Excel\ folder.
As a result, custom menus are user-specific. If you want to distribute a custom menu to others, you must either replace their .xlb file with your own or you must dynamically create the menu in code. Creating the menu in code is the best option in most cases because that approach:
Doesn’t overwrite the users’ own menu changes, the way that replacing their .xlb file does
Allows you to associate the menus with the file containing the code so that the menus appear only if that workbook, template, or add-in is loaded
The following section describes how to create a top-level menu in code so that you can distribute it as part of a workbook, template, or add-in.
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