Characteristics of Standard Add Ins

If you are going to distribute your applications, you may want to package the application as an add-in. Typically saved with an .xla extension, the add-in offers several advantages:

■ Typically, clients can bypass your Workbook_ Open code by holding down the shift key while opening the workbook. With an add-in, they cannot bypass the Workbook_Open code in this manner.

■ After the Add-Ins dialog is used to install an add-in (select Tools, Add-Ins from the main menu in Excel), the add-in will always be loaded and available.

■ Even if the macro security level is set to high, programs in an installed add-in can still run.

■ Generally, custom functions work only in the workbook in which they are defined. A custom function added to an add-in is available to all open workbooks.

■ The add-in does not show up in the list of open files in the Window menu item. The client cannot unhide the workbook by choosing Window, Unhide.

Characteristics of Standard Add-Ins 497

Converting an Excel Workbook to an Add-In 498

Having Your Client Install the Add-In 500

Using a Hidden Workbook as an Alternative to an Add-In 503

Case Study: Using a Hidden Code Workbook to Hold All Macros and Forms . . .503

Next Steps 504

There is one strange rule you need to plan for. The add-in is a hidden workbook. Because the add-in can never be displayed, your code cannot select or activate any cells in the add-in workbook. You are allowed to save data in your add-in file, but you cannot select the file. Also, if you do write data to your add-in file that you wish to be available in the future, your add-in codes need to handle saving the file. Because your clients will not realize that the add-in is there, they will never be reminded or asked to save an unsaved add-in. You might add ThisWorkbook.Save to the add-in's Workbook_BeforeClose event.

0 0

Post a comment