Results 1 to 2 of 2
  1. #1
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    I am seeing a ghost in the list of Word 2002 macro

    I've been programming the VBIDE to modify the modules in a template and
    create a brand new template containing the modified modules.

    In general, I:

    1. Modify the code in the original template using a temporary module, let's
    call this, "ship".
    2. Use OrganizerCopy to copy to the new template.
    3. Use OrganizerRename to rename the module in the new template.
    4. Use OrganizerDelete to remove "ship" from the original template.

    After the deed is done, if I close the VBIDE and look at Tools | Macros in
    Word, I see that a macro in the last copy of "ship" is listed in the macro
    list even tho the "ship" module no longer exists. I verified that the module
    no longer exists by running a macro that lists the project components. If I
    try to access the macro with the Edit button in Tools | Macros, I get a
    message box that tells me there's no such critter.

    If I exit from Word and restart Word, the ghost macro is no longer listed.
    I was able to reproduce this by starting over with a clean template file.

    I did not notice the problem until a few hours ago.

    Anybody know how to get around this?

  2. #2
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: I am seeing a ghost in the list of Word 2002 macro

    I found a simple workaround that executes much more quickly, it's better code too.

    Instead of creating a temporary module, modifying the code, and using
    Organizer as I indicated, I found that the problem is avoided and the code
    runs much faster if I instead do the following:

    1. Export each module from the Source template.
    2. Import each module into the new template.
    3. Make the modifications in the new template.

    This avoids the apparent bug using Organizer since a temporary module is
    never created in the Source template.

Posting Permissions

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