Microsoft Office Tutorials and References
In Depth Information
Figure 10-4. The New dialog showing template icons
New dialog with an icon for our template, as shown in Figure 10-4 . When we select the test.xlt
icon, Excel will create a new workbook and copy the data from the template into the workbook.
Figure 10-4. The New dialog showing template icons
It is very important to note that the data (and other things such as formatting) as well as macros
are actually copied to the workbook, after which all connection between the template and the new
workbook is severed. This is quite different from the way that Microsoft Word uses templates. A
Word template remains attached to the document. Certain changes, such as the addition of styles
or macros, can be saved either in the template or in the document itself, but Word never copies
macros from a template into a document. Also, several templates can be opened at one time (the
so-called global templates), each of which may affect the document. Word templates are dynamic;
Excel templates are static.
This reduces the usefulness of Excel templates considerably, for if we create a template that
contains lots of code, for instance, then each workbook that is based on that template will contain
its own copy of that code. This can be a major waste of space and can also make it very difficult to
maintain and upgrade the code. For these reasons, I generally avoid using Excel templates
whenever possible.
For the record, however, we should note that the following items are transferred to a new
workbook or worksheet that is based on a template:
The number and type of sheets in a workbook
Cell and sheet formats set using the Format menu
Cell styles
Page formats and print-area settings for each sheet
Cell contents
Worksheet graphics
Custom toolbars, macros, hyperlinks, and ActiveX controls on forms; custom toolbars
must be attached to the template
Protected and hidden areas of the workbook
Workbook calculation options and window display options set using the Options
command on the Tools menu
We should also note that Excel supports several types of special templates called autotemplates .
They are templates with the following names:
Macro.xlt (for Excel version 4 macros)
Search JabSto ::

Custom Search