Microsoft Office Tutorials and References
In Depth Information
10.2.3.2 Characteristics of an add-in
4.
Save the workbook as an add-in in a directory of your choice.
Select the Save As option from the File menu, select "Microsoft Excel Add-In (*.xla)"
from the "Save as type" drop-down list, navigate to the directory in which you'd like to
save the file, enter the filename in the "File name" drop-down list box (in our example,
it's SRXUtils.xla ) and press the Save button.
Every Excel workbook has a property called IsAddIn. When this property is True , Excel
considers the workbook to be an add-in. One of the consequences of this is that the
workbook becomes invisible, so we cannot simply set the IsAddIn property and then save
the project as an XLA file, since its workbook will be inaccessible from the Excel user
interface. Fortunately, Microsoft realized this and arranged it so that when we save the
file as an add-in using the Save As dialog and choosing xla in the "Save as type"
dropdown listbox, Excel will automatically change the IsAddIn property value to True . (We
can change the value to False as discussed later, in the section, Section 10.2.3.3 . )
10.2.3.2 Characteristics of an add-in
An add-in has the following characteristics that set it apart from ordinary Excel workbooks:
The workbook window and any worksheets in an add-in are hidden from view. The
intention is that the creator of the add-in can use worksheets to store supporting data for
the add-in. However, this data should not be visible to the user of the add-in. In fact, an
add-in is designed to be transparent to the user; both the code and any supporting data are
hidden from the user. Thus, if you want your add-in to expose worksheets to the user,
they must be placed in separate Excel workbook files, which can be opened by code in the
add-in at the desired time.
As you probably know, when an Excel workbook is changed and the user tries to close
the workbook, Excel displays a warning message asking if the user wants to save the
changes before closing the workbook. No such message is displayed for an add-in. Thus,
the creator of an add-in can change the data in an add-in worksheet through code without
worrying that the user of the add-in will be bothered by a message to which he or she
could not possibly respond intelligently. (Of course, it is up to the add-in's creator to save
any changes if desired, using the Save As method of the Worksheet object.)
When an Excel workbook is opened, the Workbook_Open event is fired. For an ordinary
Workbook, the user can suppress this event by holding down the Shift key. The Open
event for an add-in cannot be suppressed. This is in keeping with the tamper-proof nature
of add-ins.
Add-in macros are not displayed in the Macros dialog box, thus hiding them from the user.
Search JabSto ::




Custom Search