XLT vs XLS

O

Otto Moehrbach

Any version of Excel including 2007
I wrote a VBA project for an OP and he saved it as a template (xlt). When
the code opened that file and placed data into it and saved it as an xls, he
found that it was missing some of the standard modules. Is that related in
any way to the xlt thing?
A related question: What is the benefit of making a file an xlt file? I
realize that you don't want to change the original xlt file, but if the code
opens that file, changes it, and then savesAS another xls name, does it make
any difference if the original is an xlt or xls? Thanks for your time to
educate me a bit. Otto
 
B

Bob Phillips

I don't think the fact that it is an xlt is anything to do with the missing
modules.

An xlt file is a template, when you new a file and select that template it
creates a workbbok based upon that template, with all of its fonts, its
setup, and all of the code. The purpose is to create a style of workbooks
easily, having the style already defined.

HTH

Bob
 
O

Otto Moehrbach

Bob
Thanks for your reply. I understand what you say. My question is, why
wouldn't an xls file do the same thing, that is, open it, SaveAs a new name?
Thanks again. Otto
 
J

JLGWhiz

You can do the same thing with an .xls file, but with the .xlt, it forces
you to create a new file. You cannot inadvertantly save the .xlt file with
any changes made, whereas you could with the .xls file, thereby destroying
your template.
 
B

Bob Phillips

It will, but once you haved saved it it contains those changes. It doesn';t
retain the 'template' as a template file does.
 
A

Andrew

Any version of Excel including 2007
I wrote a VBA project for an OP and he saved it as a template (xlt).  When
the code opened that file and placed data into it and saved it as an xls,he
found that it was missing some of the standard modules.  Is that related in
any way to the xlt thing?
A related question:  What is the benefit of making a file an xlt file?  I
realize that you don't want to change the original xlt file, but if the code
opens that file, changes it, and then savesAS another xls name, does it make
any difference if the original is an xlt or xls?  Thanks for your time to
educate me a bit.  Otto

I have had a great deal of trouble in trying to use my VBA projects
(written with Excel 2003) in Excel 2007. I have found that Excel 2007
erases all of my code. I have been trying to run a project as an xlt,
which opens and saves to an xls file. I have not yet been able to do
it.
 
G

Gord Dibben

Macro-enabled Template for 2007 must be saved as *.xltm

From help on "file type"

XML file type Extension
Workbook .xlsx
Macro-enabled workbook .xlsm
Template .xltx
Macro-enabled template .xltm
Non-XML binary workbook .xlsb
Macro-enabled add-in .xlam



Gord Dibben MS Excel MVP
 
O

Otto Moehrbach

That makes good sense. Thanks. Otto

JLGWhiz said:
You can do the same thing with an .xls file, but with the .xlt, it forces
you to create a new file. You cannot inadvertantly save the .xlt file
with any changes made, whereas you could with the .xls file, thereby
destroying your template.
 
O

Otto Moehrbach

Andrew
You say " I have been trying to run a project as an xlt, which opens and
saves to an xls file. I have not yet been able to do it."
What is your code and what happens when you run it? Error message? Provide
more info on your problem. Otto
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top