Microsoft KB Archive/156942

From BetaArchive Wiki

Article ID: 156942

Article Last Modified on 8/6/2002



APPLIES TO

  • Microsoft Excel 97 Standard Edition



This article was previously published under Q156942


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 Applications 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:

156943 XL97: How to Convert an Add-in File into a Workbook


Protecting the Projects in the Workbook:

  1. In Microsoft Excel, activate the workbook you want to convert to an add-in file.
  2. On the Tools menu, point to Macro, and click Visual Basic Editor.
  3. 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)

  4. On the Tools menu, click Project name Properties.
  5. Click the Protection tab.
  6. 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:

  1. Close the Visual Basic Editor by clicking Close and Return to Microsoft Excel on the File menu.
  2. On the File menu, click Properties.
  3. In the Properties dialog box, click the Summary tab.
  4. 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.
  5. 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.
  6. Click OK to close the Properties dialog box.
  7. On the File menu, click Save As.
  8. 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.

  1. 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.


Additional query words: XL97 8.0 make making subroutine addin

Keywords: kbhowto kbfaq KB156942