![]() |
macro problems with Workbooks.Add Template
If I create a new XL workbook based on a template then the new workbook
contains all the macros that are in the template. However: If one of these macros creates a new workbook based on the same template (i.e. using Workbooks.Add Template:=TemplateLocation) then the resulting workbook does not contain the template macros. If I haven't explained this properly then please shout and I'll post more info. Any help would be much appreciated. Thanks Philip |
macro problems with Workbooks.Add Template
Thanks Dave for your comprehensive reply - I must have been having a senior
moment - it works for me too. Thanks again and sorry to trouble you w/ something so stupid Cheers Philip "Dave Peterson" wrote in message ... I couldn't duplicate your findings. I created a workbook with some code in it. I saved that workbook as a template (and closed it). Then in another workbook, I put this code: Option Explicit Sub testme() Dim newWkbk As Workbook Set newWkbk = Workbooks.Add(template:="c:\my documents\excel\book1.xlt") End Sub The new workbook had the code. Philip wrote: If I create a new XL workbook based on a template then the new workbook contains all the macros that are in the template. However: If one of these macros creates a new workbook based on the same template (i.e. using Workbooks.Add Template:=TemplateLocation) then the resulting workbook does not contain the template macros. If I haven't explained this properly then please shout and I'll post more info. Any help would be much appreciated. Thanks Philip -- Dave Peterson |
All times are GMT +1. The time now is 01:52 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com