mapping keyboard shorcuts

Sep 4, 2014 at 9:01 PM
I want to map a multi-key sequence using the xlcOnKey.
eg ALT+T+P+P

What would be the right syntax for that? I've tried things like

Now, i understand that ALT+T might be problematic, but i've also tried ALT+B+P+P in the same forms as above, and all i ever get is an ExcelDna.Integration.XlCallException

Things seem to work fine with a single character or function key.

Any ideas?

Sep 4, 2014 at 9:15 PM
Edited Sep 4, 2014 at 9:15 PM
I don't think Excel supports this through either the xlcOnKey or Application.OnKey interfaces.

It it's a ribbon command you can set up the key bindings for that.

Sep 5, 2014 at 8:31 PM
Hmm, it seems like there must be some way to do multi-key shortcuts, but i can't find anything either.

What i'm actually trying to do is intercept the SheetProtect mso command. I am able to hook up a ribbon command that uses that mso id, and thereby intercept the action when the user clicks on the button in the review tab. But, alt+t+p+p still gets through. I use this same technique to augment various other mso commands (eg FileSaveAs) and it works both in the ribbon UI and for the associated command shortcut (alt+f+a in the file save as case).

So, really, what I'm asking is how can i block, or intercept the alt+t+p+p action. I thought taking over the keyboard shortcut seems like the right way, but i'm stumped because of the multi-key aspect of it.

Thanks for taking the time to respond.
Sep 6, 2014 at 12:24 PM
Hi Roger,

You might try the Excel for Developers forum: