claudehenri
Technical User
Hi
I'm trying to add a template to my workbook but I get this error
Run time error '1004'
Method 'Add' of object 'Sheets' failed
my code is
Worksheets.Add(After:="Geometry & Loads", Count:=x, _
Type:=xlWorksheet) = ThisWorkbook.Path & "\Wave.xlt"
I also tried
Worksheets.Add After:="Geometry & Loads", Count:=x, _
Type:=ThisWorkbook.Path & "\Wave.xlt"
x has been set to 6,"Geometry & Loads" does exist in the file I want to insert into, and Wave.xlt is in the specified folder.
the code below gives a slightly different error message (1004) "Add Method of Sheets class failed"
SaveFile.Worksheets.Add After:="Geometry & Loads", _ Count:=x, Type:=ThisWorkbook.Path & "\Wave.xlt"
The help only says that to insert a template to specify the path which i have done but there is not example of this. (used record macro to get to where i my code is now)
Could anyone point out the mistake i'm making
Claude-Henri
I'm trying to add a template to my workbook but I get this error
Run time error '1004'
Method 'Add' of object 'Sheets' failed
my code is
Worksheets.Add(After:="Geometry & Loads", Count:=x, _
Type:=xlWorksheet) = ThisWorkbook.Path & "\Wave.xlt"
I also tried
Worksheets.Add After:="Geometry & Loads", Count:=x, _
Type:=ThisWorkbook.Path & "\Wave.xlt"
x has been set to 6,"Geometry & Loads" does exist in the file I want to insert into, and Wave.xlt is in the specified folder.
the code below gives a slightly different error message (1004) "Add Method of Sheets class failed"
SaveFile.Worksheets.Add After:="Geometry & Loads", _ Count:=x, Type:=ThisWorkbook.Path & "\Wave.xlt"
The help only says that to insert a template to specify the path which i have done but there is not example of this. (used record macro to get to where i my code is now)
Could anyone point out the mistake i'm making
Claude-Henri