Home > Store

Professional Excel Development: The Definitive Guide to Developing Applications Using Microsoft Excel, VBA, and .NET, 2nd Edition

Register your product to gain access to bonus material or receive a coupon.

Professional Excel Development: The Definitive Guide to Developing Applications Using Microsoft Excel, VBA, and .NET, 2nd Edition

eBook

  • Your Price: $52.79
  • List Price: $65.99
  • About Watermarked eBooks
  • This PDF will be accessible from your Account page after purchase and requires PDF reading software, such as Acrobat® Reader®.

    The eBook requires no passwords or activation to read. We customize your eBook by discreetly watermarking it with your name, making it uniquely yours.

    Watermarked eBook FAQ

Description

  • Copyright 2009
  • Pages: 1176
  • Edition: 2nd
  • eBook
  • ISBN-10: 0-321-57915-1
  • ISBN-13: 978-0-321-57915-7

This is the eBook version of the printed book. The print version of this title comes with a disc of companion content. As an eBook reader, you have access to these files.  See the instruction in back pages of your eBook or by following the steps outlined below.


“As Excel applications become more complex and the Windows development platform more powerful, Excel developers need books like this to help them evolve their solutions to the next level of sophistication. Professional Excel Development is a book for developers who want to build powerful, state-of-the-art Excel applications using the latest Microsoft technologies.”

—Gabhan Berry, Program Manager, Excel Programmability, Microsoft

“The first edition of Professional Excel Development is my most-consulted and most-recommended book on Office development. The second edition expands both the depth and range. It shines because it takes every issue one step further than you expect. The book relies on the authors’ current, real-world experience to cover not only how a feature works, but also the practical implications of using it in professional work.”

—Shauna Kelly, Director, Thendara Green

“This book illustrates techniques that will result in well-designed, robust, and maintainable Excel-based applications. The authors’ advice comes from decades of solid experience of designing and building applications. The practicality of the methods is well illustrated by the example timesheet application that is developed step-by-step through the book. Every serious Excel developer should read this and learn from it. I did.”

Bill Manville, Application Developer, Bill Manville Associates

The Start-to-Finish Guide to Building State-of-the-Art Solutions with Excel 2007

In this book, four world-class Microsoft® Excel developers offer start-to-finish guidance for building powerful, robust, and secure applications with Excel. The authors–three of whom have been honored by Microsoft as Excel Most Valuable Professionals (MVPs)–show how to consistently make the right design decisions and make the most of Excel’s most powerful new features. Using their techniques,you can reduce development costs, time to market, and hassle–and build more effective, successful solutions.

Fully updated for Excel 2007, this book starts where other books on Excel programming leave off. Through a hands-on case study project, you’ll discover best practices for planning, architecting, and building Excel applications that are robust, secure, easy to maintain, and highly usable. If you’re a working developer, no other book on Excel programming offers you this much depth, insight, or value.

•    Design worksheets that will be more useful and reliable

•    Leverage built-in and application-specific add-ins

•    Construct applications that behave like independent Windows programs

•    Make the most of the new Ribbon user interface

•    Create cross-version applications that work with legacy versions of Excel

•    Utilize XML within Excel applications

•    Understand and use Windows API calls

•    Master VBA error handling, debugging, and performance optimization

•    Develop applications based on data stored in Access, SQL Server, and other databases

•    Build powerful visualization solutions with Excel charting engine

•    Learn how to work with VB.NET and leverage its IDE

•    Automate Microsoft Excel with VB.NET

•    Create managed COM add-ins for Microsoft Excel with VB.NET

•    Develop Excel solutions with Visual Studio Tools for Office (VSTO)

•    Integrate Excel with Web Services

•    Deploy applications more securely and efficiently


How to access the companion content:

1. On your PC or MAC, open a web browser and go to this URL:

www.informit.com/title/9780321508799

Navigate to the Downloads tab and click on the “CD Contents” link.

2. Download the ZIP file (or files) from the web site to your hard drive.

3. Unzip the files and follow the directions for use in the READ ME

included in the download.

Sample Content

Table of Contents

Acknowledgments . . . xiv

About the Authors . . . xv

Chapter 1 Introduction

About This Book . . . 1

Who Should Read This Book . . . 2

Excel Developer Categories . . . 2

Excel as an Application Development Platform . . . 4

Structure . . . 7

Examples . . . 8

Supported Versions of Excel . . . 9

Typefaces . . . 10

On the CD . . . 10

Help and Support . . . 11

The Professional Excel Development Web Site . . . 12

Feedback . . . 12

Chapter 2 Application Architectures

Concepts . . . 13

Chapter 3 Excel and VBA Development Best Practices

Naming Conventions . . . 27

Best Practices for Application Structure and Organization . . . 40

General Application Development Best Practices . . . 45

Chapter 4 Worksheet Design

Principles of Good Worksheet UI Design . . . 69

Program Rows and Columns: The Fundamental UI Design Technique . . . 70

Defined Names . . . 71

Styles . . . 78

User Interface Drawing Techniques . . . 83

Data Validation . . . 88

Conditional Formatting . . . 92

Using Controls on Worksheets . . . 98

Practical Example . . . 100

Chapter 5 Function, General, and Application-Specific Add-ins

The Four Stages of an Application . . . 107

Function Library Add-ins . . . 110

General Add-ins . . . 117

Application-Specific Add-ins . . . 118

Practical Example . . . 125

Chapter 6 Dictator Applications

Structure of a Dictator Application . . . 141

Practical Example . . . 157

Chapter 7 Using Class Modules to Create Objects

Creating Objects . . . 166

Creating a Collection . . . 170

Trapping Events . . . 177

Raising Events . . . 180

Practical Example . . . 188

Chapter 8 Advanced Command Bar Handling

Command Bar Design . . . 198

Table-Driven Command Bars . . . 199

Putting It All Together . . . 219

Loading Custom Icons from Files . . . 228

Hooking Command Bar Control Events . . . 232

Practical Example . . . 241

Chapter 9 Introduction to XML

XML . . . 249

Chapter 10 The Office 2007 Ribbon User Interface

The RibbonX Paradigm . . . 273

An Introduction to the Office 2007 Open XML File Format . . . 274

Ribbon Design and Coding Best Practices . . . 278

Table-Driven Ribbon UI Customization . . . 289

Advanced Problem Solving . . . 291

Further Reading . . . 300

Related Portals . . . 300

Chapter 11 Creating Cross-Version Applications

Command Bar and Ribbon User Interfaces in a Single Application . . . 304

Other Excel 2007 Development Issues . . . 319

Windows Vista Security and Folder Structure . . . 326

Chapter 12 Understanding and Using Windows API Calls Overview . . . 331

Working with the Screen . . . 337

Working with Windows . . . 340

Working with the Keyboard . . . 349

Working with the File System and Network . . . 355

Practical Examples . . . 369

Chapter 13 UserForm Design and Best Practices

Principles . . . 375

Control Fundamentals . . . 384

Visual Effects . . . 392

UserForm Positioning and Sizing . . . 400

Wizards . . . 407

Dynamic UserForms . . . 411

Modeless UserForms . . . 419

Control Specifics . . . 425

Practical Example . . . 432

Chapter 14 Interfaces

What Is an Interface? . . . 433

Code Reuse . . . 435

Defining a Custom Interface . . . 437

Implementing a Custom Interface . . . 438

Using a Custom Interface . . . 440

Polymorphic Classes . . . 443

Improving Robustness . . . 448

Simplifying Development . . . 448

A Plug-in Architecture . . . 460

Practical Example . . . 462

Chapter 15 VBA Error Handling

Error Handling Concepts . . . 465

The Single Exit Point Principle . . . 475

Simple Error Handling . . . 475

Complex Project Error Handler Organization . . . 476

The Central Error Handler . . . 481

Error Handling in Classes and UserForms . . . 488

Putting It All Together . . . 490

Practical Example . . . 496

Chapter 16 VBA Debugging

Basic VBA Debugging Techniques . . . 507

The Immediate Window (Ctrl+G) . . . 517

The Call Stack (Ctrl+L) . . . 521

The Watch Window . . . 522

The Locals Window . . . 532

The Object Browser (F2) . . . 533

Creating and Running a Test Harness . . . 537

Using Assertions . . . 540

Debugging Shortcut Keys That Every Developer Should Know . . . 542

Chapter 17 Optimizing VBA Performance

Measuring Performance . . . 545

The PerfMon Utility . . . 546

Creative Thinking . . . 551

Macro-Optimization . . . 556

Micro-Optimization . . . 567

Chapter 18 Introduction to Database Development

An Introduction to Databases . . . 577

An Introduction to SQL . . . 594

Data Access with ADO . . . 598

Further Reading . . . 613

Chapter 19 Programming with Access and SQL Server

A Note on the Northwind Sample Database . . . 615

Designing the Data Access Tier . . . 616

Working with Microsoft Access Databases . . . 620

Working with Microsoft SQL Server Databases . . . 630

Upsizing from Access to SQL Server . . . 642

Further Reading . . . 647

Practical Example . . . 648

Chapter 20 Data Manipulation Techniques

Excel’s Data Structures . . . 661

Data Processing Features . . . 667

Advanced Functions . . . 678

Chapter 21 Advanced Charting Techniques

Fundamental Techniques . . . 687

VBA Techniques . . . 702

Chapter 22 Controlling Other Office Applications

Fundamentals . . . 709

The Primary Office Application Object Models . . . 725

Further Reading . . . 739

Practical Example . . . 740

Chapter 23 Excel and Visual Basic 6

A Hello World ActiveX DLL . . . 742

Why Use VB6 ActiveX DLLs in Excel VBA Projects . . . 758

In-Process Versus Out-of-Process . . . 774

Automating Excel from a VB6 EXE . . . 775

COM Add-ins . . . 783

A “Hello World” COM Add-in . . . 783

The Add-in Designer . . . 788

Installation Considerations . . . 790

The AddinInstance Events . . . 792

Command Bar Handling . . . 795

Why Use a COM Add-in? . . . 798

Automation Add-ins . . . 799

Practical Examples . . . 802

Chapter 24 Excel and VB.NET

.NET Framework Fundamentals . . . 818

Visual Basic.NET . . . 819

Debugging . . . 845

Useful Development Tools . . . 853

Automating Excel . . . 855

Resources in .NET Solutions . . . 863

Retrieving Data with ADO.NET . . . 864

Further Reading . . . 870

Additional Development Tools . . . 871

Q&A Forums . . . 871

Practical Example–PETRAS Report Tool .NET . . . 872

Chapter 25 Writing Managed COM Add-ins with VB.NET

Choosing a Development Toolset . . . 890

Creating a Managed COM Add-in . . . 891

Building the User Interface . . . 908

Creating Managed Automation Add-ins . . . 928

Manually Register and Unregister COM Add-ins . . . 940

Using Classes in VB.NET . . . 940

Using Classic ADO to Export Data to Excel . . . 948

Shimming COM Add-ins . . . 952

Related Blogs . . . 962

Additional Development Tools . . . 962

Practical Example–PETRAS Report Tool.NET . . . 963

Chapter 26 Developing Excel Solutions with Visual Studio Tools for Office System (VSTO)

What Is VSTO? . . . 976

When Should You Use VSTO? . . . 983

Working with VSTO Add-Ins . . . 985

Working with VSTO Templates and Workbook Solutions . . . 1006

Deployment and Security . . . 1016

Further Reading . . . 1026

Related Portal and Blogs . . . 1026

Additional Development Tools . . . 1026

Chapter 27 XLLs and the C API

Why Create an XLL-Based Worksheet Function . . . 1029

Creating an XLL Project in Visual Studio . . . 1030

The Structure of an XLL . . . 1034

The XLOPER and OPER Data Types . . . 1044

The Excel4 Function . . . 1050

Commonly Used C API Functions . . . 1052

XLOPERs and Memory Management . . . 1053

Registering and Unregistering Custom Worksheet Functions . . . 1054

Sample Application Function . . . 1057

Debugging the Worksheet Functions . . .1060

Miscellaneous Topics . . .1061

Additional Resources . . . 1062

Chapter 28 Excel and Web Services

Web Services . . . 1065

Practical Example . . . 1072

Chapter 29 Providing Help, Securing, Packaging, and Distributing

Providing Help . . . 1085

Securing . . . 1094

Packaging . ..1099

Distributing . . . 1104

Index . . . 1107

Updates

Submit Errata

More Information

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020