18.11.2014 Views

Microsoft Office

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Part VI<br />

Programming Excel with VBA<br />

n<br />

To store proprietary macros. If you don’t want end users to see (or modify) your macros, store<br />

the macros in an add-in and protect the VBA project with a password. A user can use the macros,<br />

but they can’t view or change them unless the user knows the password. An additional benefit is<br />

that the add-in doesn’t display a workbook window, which can be distracting.<br />

As previously noted, Excel ships with several useful add-ins (see the sidebar “Add-Ins Included with<br />

Excel”), and you can acquire other add-ins from third-party vendors or the Internet. In addition, Excel<br />

includes the tools that enable you to create your own add-ins. I explain this process later in the chapter (see<br />

“Creating Add-Ins”).<br />

Working with Add-Ins<br />

The best way to work with add-ins is to use Excel’s Add-In Manager. To display the Add-In Manager:<br />

1. Choose <strong>Office</strong> ➪ Excel Options<br />

2. In the Excel Options dialog box, select the Add-Ins category<br />

3. At the bottom of the dialog box, select Excel Add-Ins from the Manage list and click Go.<br />

Excel displays its Add-Ins dialog box, shown in Figure 45.1. The list box contains all the add-ins that Excel<br />

knows about. Those checked are currently open. You can open and close add-ins from this dialog box by<br />

selecting or deselecting the check boxes.<br />

FIGURE 45.1<br />

The Add-Ins dialog box.<br />

You can also open most add-in files can by choosng <strong>Office</strong> ➪ Open. After an add-in is opened,<br />

CAUTION<br />

however, you can’t choose <strong>Office</strong> ➪ Close to close it. The only way to remove the add-in is to<br />

exit and restart Excel or to write a macro to close the add-in. Therefore, you’re usually better off opening the<br />

add-ins by using the Add-Ins dialog box.<br />

772

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!