PDA

View Full Version : [SOLVED:] VBA Extensibility in Word 2010?



clhare
03-27-2014, 12:35 PM
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

macropod
03-27-2014, 11:16 PM
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.

gmaxey
03-28-2014, 05:03 AM
You might want to remove the "Trust Access to VBA project object module" when you are finished with your updates.

clhare
03-28-2014, 07:47 AM
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