| Acknowledgments |
|
xv | |
| About the Authors |
|
xvii | |
| Chapter 1: Introduction |
|
1 | (12) |
|
|
|
1 | (1) |
|
|
|
2 | (1) |
|
Excel as an Application Development Platform |
|
|
3 | (4) |
|
|
|
7 | (1) |
|
|
|
8 | (1) |
|
|
|
9 | (1) |
|
|
|
9 | (1) |
|
|
|
10 | (1) |
|
|
|
11 | (1) |
|
|
|
12 | (1) |
| Chapter 2: Application Architectures |
|
13 | (16) |
|
|
|
13 | (12) |
|
|
|
25 | (4) |
| Chapter 3: Excel and VBA Development Best Practices |
|
29 | (40) |
|
|
|
29 | (13) |
|
Best Practices for Application Structure and Organization |
|
|
42 | (5) |
|
General Application Development Best Practices |
|
|
47 | (21) |
|
|
|
68 | (1) |
| Chapter 4: Worksheet Design |
|
69 | (40) |
|
Principles of Good Worksheet UI Design |
|
|
69 | (1) |
|
Program Rows and Columns: The Fundamental UI Design Technique |
|
|
70 | (1) |
|
|
|
71 | (7) |
|
|
|
78 | (6) |
|
User Interface Drawing Techniques |
|
|
84 | (5) |
|
|
|
89 | (3) |
|
|
|
92 | (7) |
|
Using Controls on Worksheets |
|
|
99 | (2) |
|
|
|
101 | (6) |
|
|
|
107 | (2) |
| Chapter 5: Function, General and Application-Specific Add-ins |
|
109 | (34) |
|
The Four Stages of an Application |
|
|
109 | (3) |
|
|
|
112 | (8) |
|
|
|
120 | (1) |
|
Application-Specific Add-ins |
|
|
121 | (7) |
|
|
|
128 | (14) |
|
|
|
142 | (1) |
| Chapter 6: Dictator Applications |
|
143 | (24) |
|
Structure of a Dictator Application |
|
|
143 | (16) |
|
|
|
159 | (7) |
|
|
|
166 | (1) |
| Chapter 7: Using Class Modules to Create Objects |
|
167 | (32) |
|
|
|
167 | (5) |
|
|
|
172 | (7) |
|
|
|
179 | (3) |
|
|
|
182 | (8) |
|
|
|
190 | (7) |
|
|
|
197 | (2) |
| Chapter 8: Advanced Command Bar Handling |
|
199 | (56) |
|
|
|
199 | (2) |
|
Table-Driven Command Bars |
|
|
201 | (21) |
|
|
|
222 | (10) |
|
Loading Custom Icons from Files |
|
|
232 | (5) |
|
Hooking Command Bar Control Events |
|
|
237 | (9) |
|
|
|
246 | (7) |
|
|
|
253 | (2) |
| Chapter 9: Understanding and Using Windows API Calls |
|
255 | (44) |
|
|
|
255 | (6) |
|
|
|
261 | (3) |
|
|
|
264 | (10) |
|
Working with the Keyboard |
|
|
274 | (5) |
|
Working with the File System and Network |
|
|
279 | (15) |
|
|
|
294 | (3) |
|
|
|
297 | (2) |
| Chapter 10: Userform Design and Best Practices |
|
299 | (60) |
|
|
|
299 | (10) |
|
|
|
309 | (7) |
|
|
|
316 | (9) |
|
Userform Positioning and Sizing |
|
|
325 | (7) |
|
|
|
332 | (4) |
|
|
|
336 | (8) |
|
|
|
344 | (6) |
|
|
|
350 | (7) |
|
|
|
357 | (1) |
|
|
|
358 | (1) |
| Chapter 11: Interfaces |
|
359 | (32) |
|
|
|
359 | (2) |
|
|
|
361 | (2) |
|
Defining a Custom Interface |
|
|
363 | (1) |
|
Implementing a Custom Interface |
|
|
364 | (2) |
|
|
|
366 | (2) |
|
|
|
368 | (5) |
|
|
|
373 | (1) |
|
|
|
374 | (12) |
|
|
|
386 | (2) |
|
|
|
388 | (1) |
|
|
|
389 | (2) |
| Chapter 12: VBA Error Handling |
|
391 | (44) |
|
|
|
391 | (10) |
|
The Single Exit Point Principle |
|
|
401 | (1) |
|
|
|
402 | (1) |
|
Complex Project Error Handler Organization |
|
|
403 | (5) |
|
The Central Error Handler |
|
|
408 | (7) |
|
Error Handling in Classes and Userforms |
|
|
415 | (1) |
|
|
|
416 | (7) |
|
|
|
423 | (10) |
|
|
|
433 | (2) |
| Chapter 13: Programming with Databases |
|
435 | (56) |
|
An Introduction to Databases |
|
|
435 | (18) |
|
Designing the Data Access Tier |
|
|
453 | (1) |
|
Data Access with SQL and ADO |
|
|
454 | (21) |
|
|
|
475 | (2) |
|
|
|
477 | (12) |
|
|
|
489 | (2) |
| Chapter 14: Data Manipulation Techniques |
|
491 | (28) |
|
|
|
491 | (6) |
|
|
|
497 | (12) |
|
|
|
509 | (8) |
|
|
|
517 | (2) |
| Chapter 15: Advanced Charting Techniques |
|
519 | (26) |
|
|
|
519 | (18) |
|
|
|
537 | (6) |
|
|
|
543 | (2) |
| Chapter 16: VBA Debugging |
|
545 | (42) |
|
Basic VBA Debugging Techniques |
|
|
545 | (11) |
|
The Immediate Window (Ctrl+G) |
|
|
556 | (4) |
|
|
|
560 | (1) |
|
|
|
561 | (12) |
|
|
|
573 | (1) |
|
|
|
574 | (4) |
|
Creating and Running a Test Harness |
|
|
578 | (3) |
|
|
|
581 | (2) |
|
Debugging Shortcut Keys that Every Developer Should Know |
|
|
583 | (2) |
|
|
|
585 | (2) |
| Chapter 17: Optimizing VBA Performance |
|
587 | (32) |
|
|
|
587 | (1) |
|
|
|
588 | (4) |
|
|
|
592 | (6) |
|
|
|
598 | (11) |
|
|
|
609 | (7) |
|
|
|
616 | (3) |
| Chapter 18: Controlling Other Office Applications |
|
619 | (32) |
|
|
|
619 | (16) |
|
The Primary Office Application Object Models |
|
|
635 | (13) |
|
|
|
648 | (1) |
|
|
|
649 | (2) |
| Chapter 19: XLLs and the C API |
|
651 | (36) |
|
Why Create an XLL-Based Worksheet Function |
|
|
651 | (1) |
|
Creating an XLL Project in Visual Studio |
|
|
652 | (5) |
|
|
|
657 | (10) |
|
The XLOPER and OPER Data Types |
|
|
667 | (5) |
|
|
|
672 | (2) |
|
Commonly Used C API Functions |
|
|
674 | (1) |
|
XLOPERs and Memory Management |
|
|
675 | (1) |
|
Registering and Unregistering Custom Worksheet Functions |
|
|
676 | (3) |
|
Sample Application Function |
|
|
679 | (3) |
|
Debugging the Worksheet Functions |
|
|
682 | (1) |
|
|
|
683 | (1) |
|
|
|
684 | (2) |
|
|
|
686 | (1) |
| Chapter 20: Combining Excel and Visual Basic 6 |
|
687 | (58) |
|
A Hello World ActiveX DLL |
|
|
688 | (16) |
|
Why Use VB6 ActiveX DLLs in Excel VBA Projects |
|
|
704 | (15) |
|
In-Process versus Out-of-Process |
|
|
719 | (1) |
|
Automating Excel From a VB6 EXE |
|
|
720 | (9) |
|
|
|
729 | (14) |
|
|
|
743 | (2) |
| Chapter 21: Writing Add-ins with Visual Basic 6 |
|
745 | (26) |
|
|
|
745 | (4) |
|
|
|
749 | (4) |
|
Installation Considerations |
|
|
753 | (2) |
|
|
|
755 | (2) |
|
|
|
757 | (6) |
|
|
|
763 | (2) |
|
|
|
765 | (3) |
|
|
|
768 | (1) |
|
|
|
769 | (2) |
| Chapter 22: Using VB.NET and the Visual Studio Tools for Office |
|
771 | (48) |
|
|
|
771 | (3) |
|
How to Leverage the .NET Framework |
|
|
774 | (1) |
|
|
|
775 | (20) |
|
|
|
795 | (1) |
|
Hybrid VBA/VSTO Solutions |
|
|
796 | (3) |
|
|
|
799 | (6) |
|
|
|
805 | (7) |
|
|
|
812 | (1) |
|
|
|
812 | (4) |
|
|
|
816 | (3) |
| Chapter 23: Excel, XML and Web Services |
|
819 | (44) |
|
|
|
819 | (24) |
|
|
|
843 | (7) |
|
|
|
850 | (11) |
|
|
|
861 | (2) |
| Chapter 24: Providing Help, Securing, Packaging and Distributing |
|
863 | (22) |
|
|
|
863 | (9) |
|
|
|
872 | (5) |
|
|
|
877 | (6) |
|
|
|
883 | (1) |
|
|
|
884 | (1) |
| Index |
|
885 | |