PDA

View Full Version : Copy VBA code from parent Macro Enabled Template to offspring document when saving



g8r777
12-18-2011, 01:08 PM
My company uses Macro-Enabled Templates for a majority of our forms. These documents have a fair amount of VBA code attached to them. I know when saving the document created from the template that the VBA code is not actually saved. There is a reference placed in the created document back to the Macro-Enabled Template.

I would like to copy the actual code to the created document and eliminate the reference back to the template. My reasoning is that (for reasons outside the scope of this question) the template gets moved/renamed often and users sometimes end up working with a copy of a copy of a copy, etc. of the created document.

What ends up happening is that the reference back to the template gets broken somehow and we end up losing the VBA functionality in the documents we are creating.

I think this could be solved by eliminating the reference scenario all together and just having the code copied to the created document. Then whenever this document was copied, the VBA code would remain.

Is this a possibility or am I wasting my time?

Thank you,

Brian