You can provide users with all the power of VBA customization, without cluttering the Excel screen with a workbook, by creating an Add-in. Workbook files can be easily converted to Add-in files using Save As, or by changing the workbook's isAddin property to True. It is usually necessary to make some changes to the code when converting a workbook to an Add-in, to be able to refer to its hidden objects.

Once a file is an Add-in, it is no longer visible in the Excel window—its sheets still exist and can be used by the Add-in, but they are not displayed. You can still see the Add-in file in the Project Explorer in the VBE window. However, a password can be applied to lock the VBA project and prevent users from viewing or editing the project's modules and UserForms, just as you can lock the VBA project of a normal workbook.

An Add-in application can be accessed by users through menu commands, toolbar controls, or controls embedded in workbooks, though you cannot use popup menus. It can obtain and display information through functions such as MsgBox and inputBox and through UserForms. A workbook-based application usually needs some redesign in this area before it can be converted to an Add-in application.

Although Add-in files can be opened in the same way as workbooks, they work best when added to the Add-ins listed in the Add-Ins dialog box. Once added, they can be installed and uninstalled using the same dialog box. If they are installed, they will open automatically in every Excel session.

0 0

Post a comment