Share via

Macro shortcuts don't work after code module rename

Anonymous
2013-08-19T14:49:12+00:00

For years, I've had a few macros in a code module named "NewMacros" in the Normal project. I can't recall now how it got that name, but I decided to rename it to "MyMacros", which I did. Now none of my keyboard shortcuts assigned to those macros work.

I tried executing the macros manually from the Developer tab and they work fine that way.

I tried reassigning the shortcuts. All of the macros are listed, but even a reassign, either to the original shortcut or to a new one, doesn't get them to work from the shortcut.

I also tried restarting Word and rebooting the computer.

If I rename the module back to "NewMacros", then everything works fine. Surely the module doesn't have to have that exact name, does it?

Can anyone help me out of this?

Thanks

Microsoft 365 and Office | Word | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
Answer accepted by question author
  1. Charles Kenyon 166.4K Reputation points Volunteer Moderator
    2013-08-19T21:03:55+00:00

    I feel your pain! I've been there and done that. And yes, I did mean the module name.  The key is to delete the old shortcut, which holds, apparently, some sort of link to the old module name and associates it with the macro. I think you may be able to get by without deleting the old shortcut if you are now using a different shortcut, but that leaves things really confusing.

    At least with 2007 you are not building menus with them only to have to re-do everything. (My experiences with 2003 and earlier versions of Word.)

    2 people found this answer helpful.
    0 comments No comments

8 additional answers

Sort by: Most helpful
  1. Anonymous
    2014-11-05T11:25:49+00:00

    go to menu 

    click macros

    select the name of macro you want to reassign a shortcut letter

    select options

    type in shortcut letter

    click ok

    your shortcut letter should work now

    2 people found this answer helpful.
    0 comments No comments
  2. Charles Kenyon 166.4K Reputation points Volunteer Moderator
    2013-08-19T15:30:37+00:00

    It has to be the exact name it had when you assigned the shortcut.

    Try:

    1. Delete the existing shortcuts to macros in New Macros.
    2. Rename the module and
    3. Close Word (after saving).
    4. Open Word.
    5. Assign shortcuts to the macros.

    Save.

    Your shortcuts should now work. That may not all be needed, but I can't imagine it not working after you do that.

    1 person found this answer helpful.
    0 comments No comments
  3. Anonymous
    2013-08-19T21:30:35+00:00

    Thanks. I've heard that shared pain is less painful! ;-)

    I figured that the shortcut included some sort of pointer, but a competent developer would not have used a literal name. It should be an address or an offset in a table.

    But then VBA is an unholy mess. Why isn't it fully compatible with VB? If I remember correctly, there are quite a few VB features that don't work in VBA like Exit Select and multiple varnames in a DIm statement with a single "as" clause.

    Anyway, thanks for getting me back online.

    PS: I had this message all composed when I noticed the "Mark as Answer" button. When I clicked on it, it threw away my reply and I had to retype it. More crappy implementation. Does Microsoft have any good programmers left or have they all gone to Amazon or Google or Facebook or some still unknown start up?

    0 comments No comments
  4. Anonymous
    2013-08-19T17:49:55+00:00

    I assume you mean the exact name of the module, not the macro, right?

    Your procedure worked. Thanks.

    I thought I tried that, but I guess I got one or more steps out of order.

    So now I have to change all of my shortcuts, which means that I have to find out what they are. What a pain. It seems like a proper IDE would update pointers when a module gets renamed. (sigh)

    Anyway, it's working. I just have a little work to do. Thanks for the help.

    0 comments No comments