LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Worksheets.Add won't let me specify a template

In Excel 2003, the documentation for Worksheets.Add suggests that I can use
the Type parameter to specify a path to a template for an added worksheet.
This works with Sheets.Add, but produces a 1004 run-time error with
Worksheets.Add
Although the workaround is simple, the on-line help ought to be changed.

The following code will demonstrate the error in Excel 97, 2000, 2002 and
2003:

Sub NewSheet()
'This statement produces Run-time error 1004, Method 'Add' of object
'Sheets' failed
Worksheets.Add Type:="C:\VBA\Temp\Sheet1.xlt"

Sheets.Add Type:="C:\VBA\Temp\Sheet1.xlt" 'This statement works
End Sub
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding additional worksheets to an existing template Mike F Excel Discussion (Misc queries) 2 November 20th 08 07:18 PM
How do use a template for different worksheets in workbook peggy Excel Worksheet Functions 1 October 17th 08 04:53 AM
How do I import and filter worksheets into a template? fab Excel Discussion (Misc queries) 1 October 15th 06 08:06 PM
New Worksheets in a template to be pre-formatted. Mohan De Silva Excel Worksheet Functions 1 December 23rd 05 01:53 AM
Paste data repeatedly from different worksheets to a template Mike Krauss Excel Worksheet Functions 0 May 19th 05 07:50 PM


All times are GMT +1. The time now is 08:21 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"