Results 1 to 7 of 7
  1. #1
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Morden, Surrey, United Kingdom
    Posts
    1,838
    Thanks
    3
    Thanked 0 Times in 0 Posts
    I have a startup template in Word, in which I've been gradually adding useful macros as I work them out and add them. The first one was fine; it's in a macro module, Word knows it's there and it appears in the list of available macros.

    However, since then I've added several more, same place, same set up, but for some reason Word just isn't seeing them - the 'run macros' list just shows the original one and ignores the presence of the rest! How do I get it to recognise the others (and continue doing so as I add more), please?

    Beryl M


  2. #2
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts
    If you're putting the new macros into the same macro module in the startup template as the first macro, it's hard to understand why the newer macros wouldn't show up.

    How are you putting the new macros into the startup template? To get it to work right, you need to navigate to the startup template document and open the startup template document itself, then go to the code module in the startup template and add the new macros there (and then finally save and close the startup template document).

    Gary

  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts
    Some guesses:

    Seems unlikely, but just in case: you should not have the word Private before your macros, e.g., Private Sub DoNotShow() will be hidden from the dialog.

    Also unlikely: if you migrated the template from Word pre-97 (WordBasic), the first macro might be Sub MAIN(), and the macro appears in the Macros dialog under the name of the module. Time to change that so the macro has a real name, just in case that legacy approach ignores the rest of the module.

    You also might change the drop-down in the Macros dialog from All templates to Word Commands, and then change it back, to refresh the list.

  4. #4
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Morden, Surrey, United Kingdom
    Posts
    1,838
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Thanks, Jscher, but you're right, very unlikely - no 'Private' (one of the first things I checked) and the template was created from scratch in Word 2007. And since Word is closed and reopened several times a day, which presumably refreshes the list each time (both in the 'Run Macros' dialog and 'Macros' list in 'Customise toolbar') I doubt if that will make a difference, but I'm happy to try it as soon as I get to work tomorrow!

    And yes, Gary, I do open the startup template in order to add the macros and save and close afterwards (I don't think you can actually edit it if you don't), but thanks for posting anyway.

    Sigh.
    Beryl M


  5. #5
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Morden, Surrey, United Kingdom
    Posts
    1,838
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Just tried the idea for refreshing the list, but it's still just showing the one macro, the first one I wrote.

    Assuming I've got this right, I'm attaching a screendump of the macros list (and yes, the startup template is in the list):

    [attachment=90551:macroslist.jpg]

    and a copy of the startup template (there's nothing confidential in it, just a few formatting commands!). It is actually a macro-enabled document, not a template, but since Word recognises the first macro in it I'm assuming that's not a problem.

    [attachment=90552:Startup template.docm]

    If anyone feels up to having a look and telling me what I've done wrong I'd be really grateful!
    Attached Images Attached Images
    Attached Files Attached Files
    Beryl M


  6. #6
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Morden, Surrey, United Kingdom
    Posts
    1,838
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Sorry, folks, found out what I was doing wrong - I originally set up a template, but the settings here won't let me save templates (from the front, you can from the VBE!) so I transferred to a macro-enabled document and that seemed to work, so I carried on with that one. Of course I now realise that Word was picking up the one macro in the template and ignoring the ones in the document (they were named the same except for the extension, so I didn't realise!).

    Once I renamed the docm it immediately became obvious that it was the template it was using, so I copied everything from the docm to the dotm in the VBE and now it can see them fine.

    I knew it would be something stupid I was doing!
    Beryl M


  7. #7
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts
    Glad you were able to work out the solution. A .docm in the startup directory won't open automatically, the way a .dotm will (attached snapshot shows both a .docm and a .dotm in the Word startup directory, with Word open - only the .dotm is open) - so the macros in a .docm won't appear in the list.

    [attachment=90553:StartupFolder.JPG]

    It's inconvenient that you can't save a template (is that due to a group policy setting?), but as you say, saving in the VBE is a workaround.

    Gary
    Attached Images Attached Images

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •