This code should be run once in the template file, personally I just ran it from the Immediate Window (CTRL+G).
ThisWorkbook.CustomDocumentProperties.Add "TemplatePath", False, msoPropertyTypeString, ThisWorkbook.Path
Once it has been run every new workbook created from the template file will have access to the custom property 'TemplatePath'.
If you put this code in the Open event it will run every time a new workbook is created from a template and will try and create another custom property named 'TemplatePath' and Excel/VBA is not going to like that.
Bookmarks