Can I add a new worksheet using a template

  • Thread starter Thread starter John
  • Start date Start date
J

John

I have a formatted excel file with cell formatting plus an inserted bitmap
logo saved on my system as PO Template.xls

Can I add a worksheet using that file as a template?

Set newsheet = MasterWorkBook.Worksheets.Add("C:\Program Files\Bourret
Tools\_POTemplate.xlt")

VBA help says "If you are inserting a sheet based on an existing template,
specify the path to the template. The default value is xlWorksheet."

So is this valid?...

It doesn't work for me!

newsheet is still nothing after this line
 
John,
If the template has only one sheet:

Workbooks.Open "C:\Program Files\Bourret Tools\_POTemplate.xlt"
Worksheets(1).Move after:=ThisWorkbook.ActiveSheet
Set newsheet = ActiveSheet


HTH,
Bernie
MS Excel MVP
 
Maybe...

dim newSheet as object
set newsheet = masterworkbook.sheets.add(type:="C:\.....")
 
Back
Top