Book description
“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
Table of contents
- Copyright
- Praise for Professional Excel Development, Second Edition
- Acknowledgments
- About the Authors
- 1. Introduction
- 2. Application Architectures
-
3. Excel and VBA Development Best Practices
- Naming Conventions
- Best Practices for Application Structure and Organization
-
General Application Development Best Practices
- Code Commenting
- Code Readability
-
General VBA Programming Best Practices
- Use of Module Directives
- Best Practices for Variables and Constants
-
Defensive Coding
- Write Your Application in the Earliest Version of Excel That You Expect It to Run In
- Explicitly Use ByRef or ByVal
- Explicitly Call the Default Property of an Object
- Validate Arguments before Using Them in Procedures
- Use Guard Counters to Protect Against Infinite Loops
- Use Debug > Compile Early and Often
- Use CodeNames to Reference Sheet Objects
- Validate the Data Types of Selections
- Change Control
- Summary
- 4. Worksheet Design
-
5. Function, General, and Application-Specific Add-ins
- The Four Stages of an Application
- Function Library Add-ins
- General Add-ins
- Application-Specific Add-ins
-
Practical Example
-
Features
- Open and Initialize the Application
- Build a Toolbar That Gives the User Access to Each Feature
- Open and Initialize the Time Entry Workbook
- Save a Copy of the Time Entry Workbook to a Predefined Consolidation Location
- Allow the User to Add More Data Entry Rows to the Time Entry Worksheet
- Allow the User to Clear the Data Entry Area so the Time Sheet Can Be Reused
- Allow the User to Close the PETRAS Application
- Add a Custom Property to Allow the Consolidation Application to Locate All Instances of Our Time Entry Workbook
- Application Organization
-
Features
- Summary
- 6. Dictator Applications
- 7. Using Class Modules to Create Objects
- 8. Advanced Command Bar Handling
- 9. Introduction to XML
- 10. The Office 2007 Ribbon User Interface
- 11. Creating Cross-Version Applications
- 12. Understanding and Using Windows API Calls
- 13. UserForm Design and Best Practices
- 14. Interfaces
- 15. VBA Error Handling
-
16. VBA Debugging
- Basic VBA Debugging Techniques
- The Immediate Window (Ctrl+G)
- The Call Stack (Ctrl+L)
- The Watch Window
- The Locals Window
- The Object Browser (F2)
- Creating and Running a Test Harness
- Using Assertions
- Debugging Shortcut Keys That Every Developer Should Know
- Summary
-
17. Optimizing VBA Performance
- Measuring Performance
- The PerfMon Utility
- Creative Thinking
- Macro-Optimization
-
Micro-Optimization
-
VBA
- Use Matching Data Types
- Perform Explicit Conversions Instead of Implicit Conversions
- Use Len(String)=0 Instead of String=“”
- Use Left$, Right$, and Mid$ Instead of Left, Right, and Mid
- Pass Strings and Variant Arrays ByRef Instead of ByVal
- Don’t Use Option Compare Text
- Use Early-Binding Wherever Possible
- Use Integer Arithmetic Where Possible
- Use For...Each to Iterate Collections (Not by Index)
- Iterate Arrays by Index (Not For...Each)
- Use Dictionaries Instead of Collections (If Order Is Not Important)
- Don’t Use If bVariable = True Then, Just Use If bVariable Then
- Don’t Use IIf()
- Use Multiple If...ElseIf...End If Instead of Select Case
- Use With Blocks and Object Variables to Reduce Dot Operators
- Excel
-
VBA
- Summary
-
18. Introduction to Database Development
- An Introduction to Databases
- An Introduction to SQL
- Data Access with ADO
- Further Reading
- Summary
- 19. Programming with Access and SQL Server
- 20. Data Manipulation Techniques
- 21. Advanced Charting Techniques
- 22. Controlling Other Office Applications
-
23. Excel and Visual Basic 6
- A Hello World ActiveX DLL
- Why Use VB6 ActiveX DLLs in Excel VBA Projects
- In-Process Versus Out-of-Process
- Automating Excel from a VB6 EXE
- COM Add-ins
- A “Hello World” COM Add-in
- The Add-in Designer
- Installation Considerations
- The AddinInstance Events
- Command Bar Handling
- Why Use a COM Add-in?
- Automation Add-ins
- Practical Examples
- Summary
-
24. Excel and VB.NET
- .NET Framework Fundamentals
- Visual Basic.NET
-
Debugging
- Set Keyboard Shortcuts
- Enable Unmanaged Code Debugging
- The Exception Assistant
- The Object Browser (F2)
- The Error List Window (Ctrl+W Ctrl+E)
- The Command Window (Ctrl+Alt+A) and Immediate Window (Ctrl+G)
- The Output Window (Ctrl+Alt+O)
- Break Points (Ctrl+Alt+B)
- The Call Stack (Ctrl+L)
- The Quick Watch and Watch Windows
- Exceptions (Ctrl+Alt+E)
- Conditional Compilation Constants
- Using Assertions
- Useful Development Tools
- Automating Excel
- Resources in .NET Solutions
- Retrieving Data with ADO.NET
- Further Reading
- Additional Development Tools
- Q&A Forums
- Practical Example—PETRAS Report Tool .NET
- Summary
-
25. Writing Managed COM Add-ins with VB.NET
- Choosing a Development Toolset
- Creating a Managed COM Add-in
- Building the User Interface
- Creating Managed Automation Add-ins
- Manually Register and Unregister COM Add-ins
- Using Classes in VB.NET
- Using Classic ADO to Export Data to Excel
- Shimming COM Add-ins
- Related Blogs
- Additional Development Tools
- Practical Example—PETRAS Report Tool.NET
- Summary
- 26. Developing Excel Solutions with Visual Studio Tools for Office System (VSTO)
-
27. XLLs and the C API
- Why Create an XLL-Based Worksheet Function
- Creating an XLL Project in Visual Studio
- The Structure of an XLL
- The XLOPER and OPER Data Types
- The Excel4 Function
- Commonly Used C API Functions
- XLOPERs and Memory Management
- Registering and Unregistering Custom Worksheet Functions
- Sample Application Function
- Debugging the Worksheet Functions
- Miscellaneous Topics
- Additional Resources
- Summary
- 28. Excel and Web Services
- 29. Providing Help, Securing, Packaging, and Distributing
- Where are the Companion Content Files?
Product information
- Title: Professional Excel Development: The Definitive Guide to Developing Applications Using Microsoft Excel, VBA, and .NET, Second Edition
- Author(s):
- Release date: May 2009
- Publisher(s): Addison-Wesley Professional
- ISBN: 9780321579126
You might also like
book
Excel VBA Programming For Dummies, 5th Edition
Take your Excel programming skills to the next level To take Excel to the next level, …
book
Excel VBA Programming For Dummies, 6th Edition
Find out what Excel is capable of with this step-by-step guide to VBA Short of changing …
video
Visual Basic for Microsoft Excel
In this VB for Excel training course, you will learn how to apply the VBA programming …
book
Excel VBA Programming For Dummies
Take your data analysis and Excel programming skills to new heights In order to take Excel …