Microsoft Office 2000/Visual Basic Programmer's Guide |
Excel templates differ from Word templates in that when you create a new workbook based on a template, your workbook is actually a copy of that template. In Word, creating a document based on a template loads two VBA projects — one for the template, and one for the document. In Excel, only one project is loaded: the project associated with the new workbook.
Use an Excel template when you want to distribute a custom spreadsheet solution that has an Excel user interface component. For example, you might create a reporting template that's formatted in a standardized fashion, with embedded graphics, so that any reports users create with the template have the same look.
To create a new Excel template, create a new workbook and add the elements that you want to include in the template, such as code, custom dialog boxes, custom worksheet and chart layouts, toolbars, and recorded macros. Save the template file in the C:\Windows\Application Data\Microsoft\Templates folder with the .xlt extension; if user profiles are being used, save the template in the C:\Windows\Profiles\UserName\Application Data\Microsoft\Templates folder.
To create a new workbook based on a custom template, run Excel and click New on the File menu. If you saved your template in the Templates folder, it appears on the General tab of the New dialog box. Click the template, and then click OK.
Excel includes sample templates that you can install to familiarize yourself with how templates work and to get ideas for creating your own templates.