The information in this article applies to:
- Microsoft Excel 97 for Windows
SUMMARY
In Microsoft Excel 97, the process you use to create an add-in file is
different than the process for earlier versions of Microsoft Excel. This
article contains detailed information about how to create an add-in (.xla)
file in Microsoft Excel 97.
MORE INFORMATION
Add-in File Behavior
An add-in file in Microsoft Excel is a special type of workbook. An add-in
file can contain worksheets, chart sheets, and Visual Basic for Application
macros and functions. Macros and functions in an add-in file add optional
commands and features to Microsoft Excel without allowing a user to
directly view or edit them.
Unlike normal workbooks, when you open an add-in file, it is not visible on
the screen, and you cannot unhide it by clicking Unhide on the Window menu.
An add-in file is displayed in the Project Explorer window in the Visual
Basic Editor. However, you cannot view or edit an add-in file if it is
protected with a password.
Creating an Add-in File
To create an add-in file in Microsoft Excel 97, use the following two-part
process:
- Protect the projects in the workbook to prevent them from being
viewed or edited after you create the add-in file.
- Save the workbook as an add-in file.
Protecting the projects is very important in Microsoft Excel 97. In earlier
versions of Microsoft Excel, it is not necessary to protect the contents of
an add-in file. However, in Microsoft Excel 97, if you do not protect
projects in the workbook, others can view and/or edit the sheets and Visual
Basic modules in the add-in file.
For more information about converting an add-in back into a workbook in
Microsoft Excel 97, see the following article in the Microsoft Knowledge
Base:
ARTICLE-ID: Q156943
TITLE : XL97: How to Convert an Add-in File into a Workbook
Protecting the Projects in the Workbook:
- In Microsoft Excel, activate the workbook you want to convert to an add-
in file.
- On the Tools menu, point to Macro, and click Visual Basic Editor.
- In the Project Explorer window in the Visual Basic Editor, click the
following bold entry:
<Project name> (<File name>)
where <Project name> is the name of the Visual Basic project, and <File
name> is the name of the workbook you want to convert.
The entry will be similar to the following example:
VBAProject (Mybook.xls)
- On the Tools menu, click <Project name> Properties.
- Click the Protection tab.
- Select (check) the "Lock project for viewing" check box. Type a password
in the Password box. Type the same password in the "Confirm password"
box, and click OK.
Saving the Workbook as an Add-in File:
- Close the Visual Basic Editor by clicking "Close and Return to Microsoft
Excel" on the File menu.
- On the File menu, click Properties.
- In the Properties dialog box click the Summary tab.
- In the Title field, enter any name for your add-in. The name you provide
will be the name that appears in the Add-Ins dialog box.
- In the Comments field, enter any text that describes your add-in. This
description will be displayed in the Add-Ins dialog box when you select
your Add-In in the List of available add-ins.
- Click OK to close the Properties dialog box.
- On the File menu, click Save As.
- In the Save As dialog box, select "Microsoft Excel Add-In(*.xla)" in the
Save As Type box. If you want, change the file name and click Save.
When you click Save, Microsoft Excel creates the add-in.
- On the File menu, click Close.
After you create the add-in file, you can open the add-in file the same way
you open any workbook. If the add-in file contains an Auto_Open macro, the
macro runs and performs any actions for which it is programmed. Any
functions and subroutines in the add-in file are available for use in
Microsoft Excel.
|