Macros not working when template is emailed

Status
Not open for further replies.

EMH

New Member
Joined
Jul 3, 2011
Messages
9
Hi there,

I am creating a macro enabled template in Word 2010 for someone. I have some really basic macros e.g. inserting an autotext (as the end user is more familiar with macros than autotexts). When I look at the code, it references where the template is saved i.e. my C drive. If I email this template it still points to this location, and therefore won't run (run time error 5941 - the requested member of the collection does not exist). Do I just take out everything except the template name or do I need to add something else? Is there a way to update macros to reflect being saved to a different location - it seems crazy that they're not just simply attached to a file no matter where it is?

Thanks in advance!:)

Code:
Application.Templates( _
         "C:\Documents and Settings\Final\Note_Template Final.dotm" _
        ).BuildingBlockEntries("Chart Narrow").Insert Where:=Selection.Range, _
        RichText:=True
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
ThisDocument.FullName tells you what your document is called and where it was loaded from.
 
Upvote 0
I'm locking this so please post any answers in the other thread.
 
Upvote 0
Status
Not open for further replies.

Forum statistics

Threads
1,224,507
Messages
6,179,176
Members
452,893
Latest member
denay

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top