Page 23 - Excel Progamming Weekend Crash Course
P. 23
540629 FM.qxd 9/2/03 4:10 PM Page xx
xx Contents
Connecting the Property to the Property Procedures ..................................333
Array Properties ...............................................................................334
Read-Only Properties .........................................................................335
Accessing Properties in Code ...............................................................336
Class Methods ....................................................................................336
Property Validation .............................................................................336
Class Events .......................................................................................337
Reusing a Class ..................................................................................337
A Class Demonstration .........................................................................337
PART VI–Sunday Afternoon ...............................................................346
SESSION 27–Handling Runtime Errors .........................................................347
What’s a Runtime Error? ......................................................................347
The Causes of Errors ..........................................................................348
Preventing Errors ..............................................................................349
Trapping Errors ..................................................................................350
The Err Object ....................................................................................351
Error-Handling Code ...........................................................................352
Deferring Error Handling .....................................................................353
Some Error-Handling Examples .............................................................353
Ignoring an Error ..............................................................................354
Notifying the User of an Error ..............................................................354
Using an Error as a Programming Tool ....................................................355
SESSION 28–Database Tasks ......................................................................357
Databases and Excel ............................................................................357
Database Fundamentals .......................................................................358
Sorting Data ......................................................................................359
Filtering Data ....................................................................................360
Data Entry Forms ................................................................................363
Database Functions .............................................................................364
SESSION 29–Creating Add-Ins ....................................................................367
Add-Ins versus Workbooks ...................................................................367
Creating an Add-In .............................................................................369
Distributing an Add-In ........................................................................370
Using Excel’s Add-In Manager ...............................................................370
Events in Add-Ins ...............................................................................371
Functions in Add-Ins ...........................................................................371
Using VBA to Manipulate Add-Ins ..........................................................372
An Add-In Demonstration ....................................................................373
Code the Function ............................................................................374
Code the Program .............................................................................375
Create the Toolbar .............................................................................375
Securing the Code and Saving the Add-In ...............................................377
Testing the Add-In ............................................................................377