Remove Shortcuts

G

Gary''s Student

Does anyone have code that will loop over all the macros in a workbook and
remove any shortcuts assigned to the macros??

Thanks for any leads.
 
P

Peter T

Do you mean selectively remove shortcut keys to all macros in a single
workbook (hard unless you know what they are) or remove all shortcuts to
macros (easy).

Regards,
Peter T
 
G

Gary''s Student

Thanks for responding. I think the easy option is the way to go. I can
assign a shortcut, then turn on the Recorder and remove the shortcut
manually. The recorder gives:

Application.MacroOptions Macro:="Macro1", ShortcutKey:=""

So I figured I was in good shape. I could use syntax like:

For Each Macro in ActiveWorkbook.Macros
s = Macro.Name
Application.MacroOptions Macro:=s, ShortcutKey:=""
Next

However the above is pure junk! I can't find the right Objects over which I
can loop.
 
P

Peter T

Hmm.......

I deliberately sent that empty message to see if it was received, which it
was. In the last 24hrs I have tried to reply with a code example at least 6
times, none received. I even started a new thread with same subject with
similar message and code, which also vanished.

I can only assume there is something in the code that has prevented all my
messages from appearing, some coincidental unintended tag doing bad things,
perhaps.

Anyway, Gary's Student, if you still want the intended reply contact me
off-line (see below).

Regards,
Peter T
pmbthornton gmail com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top