Consulting

Results 1 to 4 of 4

Thread: VBA Extensibility in Word 2010?

  1. #1
    VBAX Mentor clhare's Avatar
    Joined
    Mar 2005
    Posts
    470
    Location

    VBA Extensibility in Word 2010?

    Hi all!

    Periodically I have to go back and update the macros in a particular group of templates. A few years back someone at my company showed me how to use VBA Extensibility and use macros to update macros. I've used this method for updating macros several times.

    We've recently begun switching from XP/Office 2003 to Windows 7/Office 2010. I am now primarily using the Windows 7 computer and today I tried setting up a macro to update the macros in several templates and couldn't get it to work. Finally, I decided to try the same macro on the XP/Office 2003 machine and it worked fine!

    Is there something that has changed for 2010 that I need to know about in order to use VBA Extensibility successfully? What I am trying to do is replace some lines of code with new code and also insert a new procedure.

    I'm supposed to give the XP/Office 2003 machine back now that I have the other one, but if I can't get this type of macro to work in Word 2010, I want to keep it for occasions just like this!

    Thanks!

    Cheryl

  2. #2
    Knowledge Base Approver VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    4,435
    Location
    You need to set:
    • a reference to the 'Microsoft Visual basic for Applications Extensibility 5.3' in Word 2010, via Tools>References in the VBE.
    • the 'Trust Access to the VBA project object model' option, via Developer|Macro Security.
    Cheers
    Paul Edstein
    [Fmr MS MVP - Word]

  3. #3
    Microsoft Word MVP 2003-2009 VBAX Guru gmaxey's Avatar
    Joined
    Sep 2005
    Posts
    3,335
    Location
    You might want to remove the "Trust Access to VBA project object module" when you are finished with your updates.
    Greg

    Visit my website: http://gregmaxey.com

  4. #4
    VBAX Mentor clhare's Avatar
    Joined
    Mar 2005
    Posts
    470
    Location
    I already had the "Microsoft Visual basic for Applications Extensibility 5.3" selected in the references. I added a check to the "Trust Access to VBA project object module" and the macro ran and did everything it was supposed to!

    I'll leave it unchecked and just re-select it whenever I need to run this type of macro.

    Thanks so much!!

    Cheryl

Posting Permissions

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