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 />

3. Locate and select your XLAM file in Windows Explorer. This example assumes that the file is<br />

named change case.xlam.<br />

4. Add a .zip extension to the file by pressing F2 and then changing the filename to changecase.xlam.zip.<br />

5. Drag the customUI folder you created in Step 1 into the change case.xlam.zip file.<br />

(Windows treats ZIP files as if they were folders.) Figure 45.6 shows the contents of the change<br />

case.xlam.zip file.<br />

FIGURE 45.6<br />

The change case.xlam.zip file contains subfolders, including the customUI folder you<br />

created.<br />

6. Double-click the rels folder within the ZIP file. This folder contains one file, .rels.<br />

7. Drag the .rels file to a location outside of the ZIP file (your Desktop, for example).<br />

8. Open the .rels file (which is an XML file) with a text editor, such as Notepad.<br />

9. Add the following line to the .rels file, before the tag:<br />

<br />

10. Drag the .rels file back into the ZIP file, overwriting the original version.<br />

11. Remove the .zip extension so that the file is back to its original name: change case.xlam.<br />

Yes, these steps represent an absurd amount of error-prone manual effort. Remember, this<br />

book was published when Excel 2007 was just released. By the time you read this book, tools<br />

should be available to simplify this task. Try searching the Web for office custom UI editor.<br />

NOTE<br />

Installing the add-in<br />

Now it’s time to try the add-in. Choose <strong>Office</strong> ➪ Excel Options ➪ Add-Ins. Select Excel Add-ins from the<br />

Manage drop-down list, and click Go.<br />

Excel displays its Add-Ins dialog box. Click the Browse button and locate the change case.xlam add-in that<br />

you just created. After you do so, the Add-Ins dialog box displays the add-in in its list. Notice that the information<br />

that you provided in the Properties panel appears here. Click OK to close the dialog box and open<br />

the add-in.<br />

780

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

Saved successfully!

Ooh no, something went wrong!