| Acknowledgments | | xxi | |
| Introduction | | xxiii | |
| | 1 | |
| | 2 | |
| | 2 | |
| | 6 | |
| | 8 | |
| | 11 | |
| | 17 | |
| | 18 | |
| | 21 | |
| | 21 | |
| | 22 | |
| | 27 | |
| Experimenting in the Immediate Window |
| | 29 | |
| | 30 | |
| | 30 | |
| Calling Functions and Sub Procedures |
| | 35 | |
| Parentheses and Argument Lists |
| | 37 | |
| | 38 | |
| Scope and Lifetime of Variables |
| | 40 | |
| | 42 | |
| | 45 | |
| | 47 | |
| | 50 | |
| | 55 | |
| | 59 | |
| | 62 | |
| | 63 | |
| | 63 | |
| | 64 | |
| | 65 | |
| | 66 | |
| | 66 | |
| | 68 | |
| | 70 | |
| | 70 | |
| | 71 | |
| | 72 | |
| | 73 | |
| | 74 | |
| | 75 | |
| | 77 | |
| | 77 | |
| Getting a Filename from a Path |
| | 78 | |
| Files in the Same Directory |
| | 81 | |
| Overwriting an Existing Workbook |
| | 81 | |
| | 82 | |
| | 83 | |
| | 83 | |
| | 85 | |
| | 87 | |
| | 89 | |
| | 90 | |
| | 91 | |
| | 93 | |
| | 93 | |
| | 95 | |
| Shortcut Range References |
| | 96 | |
| Ranges on Inactive Worksheets |
| | 96 | |
| Range Property of a Range Object |
| | 97 | |
| | 97 | |
| | 98 | |
| Ranges of Inactive Worksheets |
| | 99 | |
| More on the Cells Property of the Range Object |
| | 99 | |
| Single-Parameter Range Reference |
| | 101 | |
| | 102 | |
| | 103 | |
| | 105 | |
| | 105 | |
| | 107 | |
| | 108 | |
| | 110 | |
| Referring to Ranges with End |
| | 110 | |
| | 111 | |
| Columns and Rows Properties |
| | 112 | |
| | 113 | |
| Union and Intersect Methods |
| | 115 | |
| | 115 | |
| Transferring Values between Arrays and Ranges |
| | 118 | |
| | 121 | |
| | 123 | |
| | 125 | |
| | 127 | |
| Using the Name Property of the Range Object |
| | 128 | |
| | 128 | |
| | 129 | |
| | 130 | |
| | 131 | |
| Working with Named Ranges |
| | 132 | |
| | 133 | |
| Searching for the Name of a Range |
| | 135 | |
| Determining which Names Overlap a Range |
| | 136 | |
| | 139 | |
| | 141 | |
| | 141 | |
| | 142 | |
| | 144 | |
| | 144 | |
| | 145 | |
| | 146 | |
| | 147 | |
| | 148 | |
| | 148 | |
| | 149 | |
| | 153 | |
| | 154 | |
| | 156 | |
| | 158 | |
| | 159 | |
| | 161 | |
| Creating a PivotTable Report |
| | 162 | |
| | 165 | |
| | 165 | |
| | 166 | |
| | 170 | |
| | 171 | |
| | 171 | |
| | 175 | |
| | 176 | |
| | 177 | |
| | 178 | |
| | 180 | |
| | 181 | |
| | 182 | |
| | 184 | |
| Adding a Chart Sheet Using VBA Code |
| | 184 | |
| | 185 | |
| | 186 | |
| Adding an Embedded Chart Using VBA Code |
| | 186 | |
| | 187 | |
| Defining Chart Series with Arrays |
| | 190 | |
| Converting a Chart to Use Arrays |
| | 193 | |
| Determining the Ranges Used in a Chart |
| | 194 | |
| | 195 | |
| | 196 | |
| | 199 | |
| | 199 | |
| | 200 | |
| | 201 | |
| | 202 | |
| | 202 | |
| | 205 | |
| | 206 | |
| | 207 | |
| | 208 | |
| | 209 | |
| Form and ActiveX Controls |
| | 209 | |
| | 210 | |
| | 211 | |
| | 211 | |
| | 212 | |
| | 212 | |
| | 214 | |
| | 216 | |
| | 220 | |
| | 221 | |
| Text Files and File Dialog |
| | 223 | |
| | 223 | |
| | 224 | |
| | 226 | |
| Writing to Text Files Using Print |
| | 227 | |
| | 229 | |
| Flexible Separators and Delimiters |
| | 230 | |
| | 233 | |
| | 235 | |
| | 235 | |
| | 235 | |
| | 235 | |
| | 236 | |
| | 238 | |
| Working with XML and the Open XML File Formats |
| | 239 | |
| The Basics of Using XML Data in Excel |
| | 240 | |
| | 240 | |
| Consuming XML Data Directly |
| | 246 | |
| Creating and Managing Your Own XML Maps |
| | 249 | |
| Using VBA to Program XML Processes |
| | 253 | |
| | 253 | |
| Leveraging DOM and XPath to Manipulate XML Files |
| | 258 | |
| Using VBA to Program Open XML Files |
| | 265 | |
| Programming Open XML Files with VBA |
| | 266 | |
| Programmatically Zipping an Excel Container |
| | 267 | |
| | 272 | |
| | 273 | |
| | 273 | |
| | 275 | |
| Directly Accessing Controls in UserForms |
| | 277 | |
| Stopping the Close Button |
| | 281 | |
| | 282 | |
| | 288 | |
| | 288 | |
| | 291 | |
| | 291 | |
| | 293 | |
| | 293 | |
| | 294 | |
| Adding the Customizations |
| | 294 | |
| | 295 | |
| | 298 | |
| | 299 | |
| | 299 | |
| | 300 | |
| | 301 | |
| | 303 | |
| | 305 | |
| Other RibbonX Elements, Attributes, and Callbacks |
| | 307 | |
| Sharing Controls among Multiple Workbooks |
| | 308 | |
| Updating Controls at Run Time |
| | 309 | |
| Hooking Built-in Controls |
| | 311 | |
| RibbonX in Dictator Applications |
| | 312 | |
| Customizing the Office Menu |
| | 312 | |
| | 313 | |
| Controlling Tabs, Tab Sets, and Groups |
| | 313 | |
| | 314 | |
| dropDown, comboBox, and gallery |
| | 315 | |
| | 315 | |
| CommandBar Extensions for the Ribbon |
| | 316 | |
| | 317 | |
| | 318 | |
| | 319 | |
| Toolbars, Menu Bars, and Popups |
| | 320 | |
| Excel's Built-in Command Bars |
| | 322 | |
| | 325 | |
| | 328 | |
| | 330 | |
| | 332 | |
| | 333 | |
| | 334 | |
| | 335 | |
| | 338 | |
| Showing Popup Command Bars |
| | 342 | |
| Table-Driven Command Bar Creation |
| | 344 | |
| | 354 | |
| | 355 | |
| Creating Your Own Objects |
| | 356 | |
| | 357 | |
| | 359 | |
| | 360 | |
| | 363 | |
| Trapping Application Events |
| | 363 | |
| | 365 | |
| A Collection of UserForm Controls |
| | 368 | |
| Referencing Classes Across Projects |
| | 370 | |
| | 371 | |
| | 373 | |
| | 374 | |
| | 374 | |
| | 375 | |
| | 376 | |
| | 377 | |
| | 377 | |
| | 379 | |
| | 381 | |
| Removing an Add-in from the Add-ins List |
| | 381 | |
| | 382 | |
| Automation Add-Ins and COM Add-Ins |
| | 383 | |
| | 383 | |
| A Simple Add-In --- Sequence |
| | 384 | |
| Registering Automation Add-Ins with Excel |
| | 385 | |
| | 386 | |
| Introducing the IDTExtensibility2 Interface |
| | 388 | |
| | 394 | |
| The IDTExtensibility2 Interface (Continued) |
| | 395 | |
| Registering a COM Add-In with Excel |
| | 395 | |
| | 396 | |
| | 409 | |
| Interacting with Other Office Applications |
| | 411 | |
| Establishing the Connection |
| | 411 | |
| | 412 | |
| | 414 | |
| Opening a Document in Word |
| | 416 | |
| Accessing an Active Word Document |
| | 417 | |
| Creating a New Word Document |
| | 418 | |
| | 419 | |
| Access, Excel, and, Outlook |
| | 420 | |
| | 423 | |
| Readable Document Variables |
| | 428 | |
| | 430 | |
| | 431 | |
| An Introduction to Structured Query Language (SQL) |
| | 431 | |
| | 432 | |
| | 434 | |
| | 434 | |
| | 435 | |
| | 436 | |
| | 437 | |
| | 441 | |
| | 445 | |
| Using ADO in Microsoft Excel Applications |
| | 447 | |
| Using ADO with Microsoft Access |
| | 448 | |
| Using ADO with Microsoft SQL Server |
| | 454 | |
| Using ADO with Non-Standard Data Sources |
| | 463 | |
| | 468 | |
| | 469 | |
| The External Data User Interface |
| | 469 | |
| | 470 | |
| | 471 | |
| The QueryTable and ListObject |
| | 472 | |
| A QueryTable from a Relational Database |
| | 472 | |
| A Query Table Associated with a ListObject |
| | 475 | |
| QueryTables and Parameter Queries |
| | 476 | |
| QueryTables from Web Queries |
| | 479 | |
| A QueryTable from a Text File |
| | 482 | |
| Creating and Using Connection Files |
| | 484 | |
| The WorkbookConnection Object and the Connections Collection |
| | 487 | |
| External Data Security Settings |
| | 489 | |
| | 490 | |
| The Trust Center and Document Security |
| | 491 | |
| | 491 | |
| | 492 | |
| | 492 | |
| | 494 | |
| | 495 | |
| | 497 | |
| | 498 | |
| | 499 | |
| | 501 | |
| Automating Document Inspection |
| | 503 | |
| The RemoveDocumentlnformation Method |
| | 503 | |
| The Documentinspectors Collection |
| | 505 | |
| | 506 | |
| Browsing OLAP Data Sources with Excel |
| | 507 | |
| Analyzing OLAP Data via Pivot Tables |
| | 508 | |
| Connecting to an OLAP Data Source |
| | 508 | |
| Browsing the OLAP Data Source |
| | 510 | |
| Understanding the MDX behind OLAP-based Pivot Tables |
| | 512 | |
| | 513 | |
| Browsing OLAP Data Sources without Pivot Tables |
| | 517 | |
| Using ADO to Return Flattened Recordsets |
| | 517 | |
| Using ADO MD to Get Cube Schema Information |
| | 518 | |
| Creating an Inventory of Dimensions, Hierarchies, and Levels |
| | 519 | |
| | 521 | |
| Creating an Offline Cube Manually |
| | 521 | |
| Using the CreateCubeFile Method |
| | 521 | |
| Creating an Offline Cube Using ADO MD and VBA |
| | 522 | |
| | 523 | |
| | 525 | |
| What Can the Internet Do for You? |
| | 526 | |
| Using the Internet for Storing Workbooks |
| | 526 | |
| Using the Internet as a Data Source |
| | 527 | |
| Opening Web Pages as Workbooks |
| | 528 | |
| | 528 | |
| Parsing Web Pages for Specific Information |
| | 530 | |
| Using the Internet to Publish Results |
| | 531 | |
| | 532 | |
| Saving Worksheets as Web Pages |
| | 532 | |
| Creating Interactive Web Pages |
| | 533 | |
| Using the Internet as a Communication Channel |
| | 533 | |
| Communicating with a Web Server |
| | 534 | |
| | 536 | |
| | 537 | |
| Changing Windows Regional Settings and the Office 2007 UI Language |
| | 537 | |
| Responding to Regional Settings and the Windows Language |
| | 538 | |
| Identifying the User's Regional Settings and Windows Language |
| | 538 | |
| VBA Conversion Functions from an International Perspective |
| | 539 | |
| | 545 | |
| | 545 | |
| | 548 | |
| The Rules for Working with Excel |
| | 548 | |
| | 549 | |
| | 549 | |
| | 549 | |
| | 550 | |
| | 550 | |
| The Rules for Working with Your Users |
| | 551 | |
| Excel 2007's International Options |
| | 552 | |
| Features That Don't Play by the Rules |
| | 554 | |
| | 555 | |
| | 556 | |
| The ShowDataForm Sub Procedure |
| | 556 | |
| | 557 | |
| PivotTable Calculated Fields and Items, and Conditional Format and Data Validation Formulas |
| | 557 | |
| | 558 | |
| =TEXT() Worksheet Function |
| | 558 | |
| The Range.Value, Range.Formula, and Range.FormulaArray Properties |
| | 559 | |
| The Range.AutoFilter Method |
| | 559 | |
| The Range.AdvancedFilter Method |
| | 559 | |
| The Application.Evaluate, Application.ConvertFormula, and Application.ExecuteExcel4Macro Functions |
| | 560 | |
| Responding to Office 2007 Language Settings |
| | 560 | |
| Where Does the Text Come From? |
| | 560 | |
| Identifying the Office Ul Language Settings |
| | 562 | |
| Creating a Multilingual Application |
| | 562 | |
| Working in a Multilingual Environment |
| | 564 | |
| The Rules for Developing a Multilingual Application |
| | 565 | |
| | 565 | |
| | 566 | |
| | 566 | |
| | 567 | |
| The ReplaceHolders Function |
| | 568 | |
| | 568 | |
| | 571 | |
| Identifying VBE Objects in Code |
| | 572 | |
| | 572 | |
| | 572 | |
| | 573 | |
| | 574 | |
| | 574 | |
| | 574 | |
| | 575 | |
| Adding Menu Items to the VBE |
| | 576 | |
| | 580 | |
| | 589 | |
| | 594 | |
| | 598 | |
| | 599 | |
| | 600 | |
| Programming with the Windows API |
| | 601 | |
| | 602 | |
| Interpreting C-Style Declarations |
| | 603 | |
| Constants, Structures, Handles, and Classes |
| | 606 | |
| What If Something Goes Wrong? |
| | 609 | |
| Wrapping API Calls in Class Modules |
| | 611 | |
| | 616 | |
| A High-Resolution Timer Class |
| | 616 | |
| Class Module CHighResTimer |
| | 616 | |
| | 618 | |
| | 619 | |
| Modifying UserForm Styles |
| | 622 | |
| | 623 | |
| | 624 | |
| | 625 | |
| | 626 | |
| | 627 | |
| | 628 | |
| | 634 | |
| Appendix A: Excel 2007 Object Model | | 635 | |
| Appendix B: VBE Object Model | | 971 | |
| Appendix C: Office 2007 Object Model | | 995 | |
| Index | | 1079 | |