Results 1 to 6 of 6
  1. #1
    New Lounger
    Join Date
    Apr 2012
    Posts
    2
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Word macros in the Quick Access Toolbar

    I'm using Word 2007 (O my dear Word 2033!!!)...
    I have several macros imported from my old normal.dot that WORK OK in Word 2007. They run, I can assign a keyboard shortcut to them, everything is fine but... If I try to put a button in the QAT assigned to one of my macros:
    a) I do everything well: Customize, More commands, Macros, Select the macro, Add, OK.
    b) The icon appears in the QAT. The (hidden) name appears when placing the cursor on it. But...
    c) When the icon is pressed, the macro that runs is NOT what I selected but the FIRST MACRO of the list. Always. I deleted that macro and now the button runs the first macro (what was the second). I don't want to delete or rename all my macros. If I place two buttons, each assigned to a different macro, both run the same macro, that is the first of the list.
    How can I fix this bug?
    Thanks.
    Ricardo Roman

  2. #2
    Silver Lounger Charles Kenyon's Avatar
    Join Date
    Jan 2001
    Location
    Sun Prairie, Wisconsin, Wisconsin, USA
    Posts
    2,048
    Thanks
    124
    Thanked 119 Times in 116 Posts
    If you still have Word 2003 create a custom toolbar with your macros (you can put custom icons on it, too).
    Save that in a template, put it into your Word 2007 startup. It will show up under custom toolbars in the Add-Ins tab.

    Seriously, I don't know what is happening with your system. I'm assuming that the names of the macros are different. I can't reproduce the problem but what I suggested would work. You could then put a link to the custom toolbars on your QAT.
    Charles Kyle Kenyon
    Madison, Wisconsin

  3. The Following User Says Thank You to Charles Kenyon For This Useful Post:

    Ricardo Roman (2012-04-01)

  4. #3
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts
    Can you post a sample template that demonstrates this problem?

    Are all the macros named uniquely in one module or do you use different modules and the same sub name?
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  5. #4
    New Lounger
    Join Date
    Apr 2012
    Posts
    2
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Hi Charles:
    Thanks! Your words opened the road for me "I can't reproduce the problem...". So I thought that the problem was that the macros had been created with Word 2003. So I mede an experiment. I created a "new" macro in Word 2007 and pasted the old macro. Close, save and SEE what's the new macro name in Word 2007.
    Briefly: my old macros said
    PUBLIC SUB MAIN()
    xxx
    xxx
    End SUB

    The new macro (suppose BW3) said
    SUB BW3()
    xxx
    xxx
    End SUB

    So I edited all my macros, deleting "PUBLIC" and writing the name of each macro instead of "MAIN".
    I hope that Word will not crash, but the macros work OK, the icons appear in the QAT and they WORK as expected.

    Again, thank you very much for trying and answering.
    Ricardo.






    Quote Originally Posted by Charles Kenyon View Post
    If you still have Word 2003 create a custom toolbar with your macros (you can put custom icons on it, too).
    Save that in a template, put it into your Word 2007 startup. It will show up under custom toolbars in the Add-Ins tab.

    Seriously, I don't know what is happening with your system. I'm assuming that the names of the macros are different. I can't reproduce the problem but what I suggested would work. You could then put a link to the custom toolbars on your QAT.

  6. #5
    Silver Lounger Charles Kenyon's Avatar
    Join Date
    Jan 2001
    Location
    Sun Prairie, Wisconsin, Wisconsin, USA
    Posts
    2,048
    Thanks
    124
    Thanked 119 Times in 116 Posts
    The "Public" does not matter. It is the default status of macros. I am ignorant enough with vba but believe that MAIN is an old name, possibly from a WordBasic macro and indicates a special macro.

    If you had three macros named PUBLIC SUB MAIN you had three macros named MAIN. It doesn't surprise me that the QAT would only open one of them.
    Charles Kyle Kenyon
    Madison, Wisconsin

  7. #6
    5 Star Lounger kmurdock's Avatar
    Join Date
    Feb 2003
    Location
    Pacific Grove, California, USA
    Posts
    716
    Thanks
    10
    Thanked 34 Times in 28 Posts
    The key here is that the macros are now saved in a 2007 xxx.dotm template file. The QAT interface can't "see" individual macros in xxx.dot files.

    Charles is right in that "Public Sub" and "Sub" are both interpreted as public macros. Both will be visible in a xxx.dotm file.

    Best, Kim

  8. The Following User Says Thank You to kmurdock For This Useful Post:

    Ricardo Roman (2012-04-02)

Posting Permissions

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