Page 11 - Microsoft Office Excel 2003 Programming Inside Out
P. 11
Table of Contents
Manipulating Dates and Times . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
Time and Date Serial Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
Date and Time Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
Chapter 10
Formatting Excel Objects 219
Using Excel Color Constants and the Color Palette . . . . . . . . . . . . . . . . . 219
Manipulating the Current Excel Color Palette . . . . . . . . . . . . . . . . . 223
Using the Excel Color Palette on the Web . . . . . . . . . . . . . . . . . . . . 226
Formatting Worksheet Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
Formatting Fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
Formatting Cells. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
Formatting Borders. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236
Chapter 11
Creating Add-Ins and COM Add-Ins 239
Introducing Add-Ins. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
Using the Add-Ins dialog box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
Installing an Add-In. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
Unloading an Add-In . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
Creating Excel Add-Ins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
Creating an Add-In . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
Saving the Add-In . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242
Installing the Add-In . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
Using the AddIns Collection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
AddIns Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
AddIn Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
Creating Automation and COM Add-Ins. . . . . . . . . . . . . . . . . . . . . . . . . . 247
Using the IDTExtensibility2 Interface. . . . . . . . . . . . . . . . . . . . . . . . 248
Registry Keys. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250
Building an Automation Add-In with Visual Basic 6 . . . . . . . . . . . . . . . . . 250
Designing the Add-In. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250
Registry Entries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
Building a COM Add-In with Visual Basic .NET. . . . . . . . . . . . . . . . . . . . . 256
Running the Shared Add-In Wizard . . . . . . . . . . . . . . . . . . . . . . . . . 257
Modifying the Template. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
Installing the Add-In . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261
Chapter 12
Understanding and Using Events 265
Enabling and Disabling Events. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266
Workbook Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
Open Event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
Activate Event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
SheetActivate Event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270
xi