Context menus

Your own right-click entries, and what Excel refuses to forget.

You can attach your own entries to Excel's right-click menus: on cells, columns, rows and a few other targets.

Structure

A menu has a target and a list of entries. An entry is a button with VBA behind it, a heading, or a separator. The code works exactly as in the ribbon.

Reset on load

Unlike the ribbon, Excel does not rebuild context menus on every start. It remembers changes permanently, in a file in the user profile.

Two surprises follow from that:

  • Without a reset, entries pile up. Start your add-in twice and your entry appears twice. The reset on load option clears up first.
  • After uninstalling they stay, until Excel restarts. With no add-in there is nobody left to clean up. That is Excel's behaviour, not a defect. Restart Excel to be rid of them immediately.

The reset clears the whole bar, including entries from other add-ins. That is why it is an option and not always on.

Hiding built-in entries

This option hides Excel's own entries in the chosen menu. It forces the reset on load, because otherwise the hiding loop runs again on every start.

In current Excel versions it works only partly: some entries come back. If you need a genuinely private menu, a popup bar of your own is the better route. That is on the list, not built yet.