PDA

View Full Version : Hotkey Addin Macro on the Ribbon



sean262123
02-26-2011, 02:46 AM
I created an addin with a macro that I put on the ribbon. I would like the user to be able to call the macro with a hot-key combination if possible.

I noticed that if the macro is put in the personal macro workbook it can be hotkeyed because it shows up under view->macros. But don't see a direct way to do this for addin-macros.

Bob Phillips
02-26-2011, 08:15 AM
Shouldn't be any different just because it is in an addin. Is the macro private, or have parameters?

sean262123
02-26-2011, 03:23 PM
No. The macro appears in Project Explorer in a separate project called "VBA_Project (test_Addin.xlam)" under module1: "Public sub add2Nums()"

If I go to view macros, all workbooks, addin macros are hidden. This is the only way I know to hotkey a macro, but they don't appear here.

However, if I go to customize quick access toolbar, click macros. Then the macros will appear from the addin, and I can put them on the ribbon. Still no hotkey though.

Paul_Hossler
02-27-2011, 08:44 AM
However, if I go to customize quick access toolbar, click macros. Then the macros will appear from the addin, and I can put them on the ribbon,


Are you adding the macro to the QAT or to the Ribbon. The handling is different

2007 or 2010?

Paul

Bob Phillips
02-28-2011, 01:10 AM
When you go to View Macros, select the macro, then click the Options button. You can set the hotkey from there.