Accessing An Addin As A Workbook

As I mention earlier, there are two ways to open an add-in file: with the File ^ Open command and with the Tools ^ Add-Ins command. The latter method is the preferred method for the following reason: When you open an add-in with the File ^ Open command, its Installed property is not set to True. Therefore, you cannot close the file by using the Add-Ins dialog box. In fact, the only way to close such an add-in is with a VBA statement such as the following:

Workbooks("Myaddin.xla").Close

Using the Close method on an installed add-in removes the add-in from memory, but it does not set its Installed property to False. Therefore, the Add-Ins dialog box still lists the add-in as installed, which can be very confusing. The proper way to remove an installed add-in is to set its Installed property to False.

As you might have surmised, Excel's add-in capability is a bit quirky, and this component has not been improved in many years. Therefore, as a developer, you need to pay particular attention to issues involving installing and uninstalling add-ins.

0 0

Post a comment