ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Insert Custom Sheet.xlt (https://www.excelbanter.com/excel-programming/347828-insert-custom-sheet-xlt.html)

Desert Piranha[_16_]

Insert Custom Sheet.xlt
 

Hi all,

I have a custom "Book.xlt" which is opening as "Book1" when Excel
opens, no problems.

I have a "Sheet.xlt" in the same folder as the Book.xlt, that if when i
use "Insert, Worksheet" it
opens fine. No problems. (They are the same formating)

If i use:

Code:
--------------------
Sub AddWorkSheetAtEnd()
Worksheets.Add After:=Worksheets(Worksheets.Count)
End Sub
--------------------
then i get a OLD default worksheet.

How can i word the code to open the custom "Sheet.xlt", as when i use
"Insert,WorkSheet" ?

Xl 2000
Book.xlt and Sheet.xlt are in:
C:\Documents and Settings\Owner\Application
Data\Microsoft\Excel\XLSTART


--
Desert Piranha


------------------------------------------------------------------------
Desert Piranha's Profile: http://www.excelforum.com/member.php...o&userid=28934
View this thread: http://www.excelforum.com/showthread...hreadid=492495


keepITcool

Insert Custom Sheet.xlt
 

simpler than you think :)
(but it fails if you use worksheets collection iso sheets

Sheets.Add After:=Sheets(Sheets.Count), _
Type:=Application.TemplatesPath & "\TestSheet.xlt"


--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Desert Piranha wrote :


Hi all,

I have a custom "Book.xlt" which is opening as "Book1" when Excel
opens, no problems.

I have a "Sheet.xlt" in the same folder as the Book.xlt, that if when
i use "Insert, Worksheet" it
opens fine. No problems. (They are the same formating)

If i use:

Code:
--------------------
Sub AddWorkSheetAtEnd()
Worksheets.Add After:=Worksheets(Worksheets.Count)
End Sub
--------------------
then i get a OLD default worksheet.

How can i word the code to open the custom "Sheet.xlt", as when i use
"Insert,WorkSheet" ?

Xl 2000
Book.xlt and Sheet.xlt are in:
C:\Documents and Settings\Owner\Application
Data\Microsoft\Excel\XLSTART


Desert Piranha[_17_]

Insert Custom Sheet.xlt
 

Hi keepITcool,

This will work.
I had to put a Sheet.xlt into the Template folder.
One thing is, when it inserts a new sheet,
it names them as Sheet1(2), Sheet1(3), Sheet1(4) etc
instead of Sheet2, Sheet3, Sheet4.

I can live with it though.

thx
Dave
keepITcool Wrote:
simpler than you think :)
(but it fails if you use worksheets collection iso sheets

Sheets.Add After:=Sheets(Sheets.Count), _
Type:=Application.TemplatesPath & "\TestSheet.xlt"


--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Desert Piranha wrote :


Hi all,

I have a custom "Book.xlt" which is opening as "Book1" when Excel
opens, no problems.

I have a "Sheet.xlt" in the same folder as the Book.xlt, that i

when
i use "Insert, Worksheet" it
opens fine. No problems. (They are the same formating)

If i use:

Code:
--------------------
Sub AddWorkSheetAtEnd()
Worksheets.Add After:=Worksheets(Worksheets.Count)
End Sub
--------------------
then i get a OLD default worksheet.

How can i word the code to open the custom "Sheet.xlt", as when

use
"Insert,WorkSheet" ?

Xl 2000
Book.xlt and Sheet.xlt are in:
C:\Documents and Settings\Owner\Application
Data\Microsoft\Excel\XLSTAR


--
Desert Piranh

-----------------------------------------------------------------------
Desert Piranha's Profile: http://www.excelforum.com/member.php...fo&userid=2893
View this thread: http://www.excelforum.com/showthread.php?threadid=49249



All times are GMT +1. The time now is 11:55 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com