Why program Excel? For solving complex calculations and presenting results, Excel is amazingly complete with every imaginable feature already in place. But programming Excel isn't about adding new features as much as it's about combining existing features to solve particular problems. With a few modifications, you can transform Excel into a task-specific piece of software that will quickly and precisely serve your needs. In other words, Excel is an ideal platform for probably millions of small spreadsheet-based software solutions.
The best part is, you can program Excel with no additional tools. A variant of the Visual Basic programming language, VB for Applications (VBA) is built into Excel to facilitate its use as a platform. With VBA, you can create macros and templates, manipulate user interface features such as menus and toolbars, and work with custom user forms or dialog boxes. VBA is relatively easy to use, but if you've never programmed before, Programming Excel with VBA and .NET is a great way to learn a lot very quickly. If you're an experienced Excel user or a Visual Basic programmer, you'll pick up a lot of valuable new tricks. Developers looking forward to .NET development will also find discussion of how the Excel object model works with .NET tools, including Visual Studio Tools for Office (VSTO).
This book teaches you how to use Excel VBA by explaining concepts clearly and concisely in plain English, and provides plenty of downloadable samples so you can learn by doing. You'll be exposed to a wide range of tasks most commonly performed with Excel, arranged into chapters according to subject, with those subjects corresponding to one or more Excel objects. With both the samples and important reference information for each object included right in the chapters, instead of tucked away in separate sections, Programming Excel with VBA and .NET covers the entire Excel object library. For those just starting out, it also lays down the basic rules common to all programming languages.
With this single-source reference and how-to guide, you'll learn to use the complete range of Excel programming tasks to solve problems, no matter what you're experience level.
Inhaltsverzeichnis
Preface
Part I. Learning VBA
1. Becoming an Excel Programmer
Why Program?
Record and Read Code
Change Recorded Code
Fix Misteakes
Start and Stop
View Results
Where's My Code?Macros and Security
Write Bug-Free Code
Navigate Samples and Help
What You've Learned
2. Knowing the Basics
Parts of a Program
Classes and Modules
Procedures
Variables
Conditional Statements
Loops
Expressions
Exceptions
What You've Learned
3. Tasks in Visual Basic
Types of Tasks
Interact with Users
Do Math
Work with Text
Get Dates and Times
Read and Write Files
Check Results
Find Truth
Compare Bits
Run Other Applications
Control the Compiler
Not Covered Here
What You've Learned
4. Using Excel Objects
Objects and Their Members
Get Excel Objects
Get Objects from Collections
About Me and the Active Object
Find the Right Object
Common Members
Respond to Events in Excel