Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
macro problems with Workbooks.Add Template
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Problems with shared workbooks | Excel Discussion (Misc queries) | |||
Problems opening excel workbooks | Excel Discussion (Misc queries) | |||
linking problems and worksheets and workbooks | Excel Discussion (Misc queries) | |||
Problems when printing large workbooks | Excel Discussion (Misc queries) | |||
Problems with referring to workbooks | Excel Programming |