Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding new worksheet from template in code
Hello,
I need to be able to add a new worksheet from code, using an existing (1-sheet) template. I can only find code to open a complete new workbook using an exisiting template. Is this possible? If yes, how? Thanks for your answers. Ed van Wijngaarden |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding new worksheet from template in code
Hi Ed,
Create a template file as you require, and save it as a template file in the Excel XLStart directory named Sheet. When you add a new sheet ACtiveWorkbook.Worksheets.Add it will be based upon this template. Main problem, all sheets you add, in code or manually will have this template. But new workbooks don't have to, you can create a separate template file called Book for that, again in XLStart. -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "E.J. van Wijngaarden" wrote in message ... Hello, I need to be able to add a new worksheet from code, using an existing (1-sheet) template. I can only find code to open a complete new workbook using an exisiting template. Is this possible? If yes, how? Thanks for your answers. Ed van Wijngaarden |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding new worksheet from template in code
This worked for me:
Sheets.Add Type:="c:\my documents\excel\book3.xls" (don't use worksheets.add) "E.J. van Wijngaarden" wrote: Hello, I need to be able to add a new worksheet from code, using an existing (1-sheet) template. I can only find code to open a complete new workbook using an exisiting template. Is this possible? If yes, how? Thanks for your answers. Ed van Wijngaarden -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
adding a "relationship code" to a worksheet | Excel Worksheet Functions | |||
Adding additional worksheets to an existing template | Excel Discussion (Misc queries) | |||
Adding a new Excel template | Excel Discussion (Misc queries) | |||
Excel template-run code on open | Excel Programming | |||
Check my code to use template? | Excel Programming |