Wiley – 2007, 584 pages, 2nd edition
ISBN: 0470027975, 9780470027974
Financial Applications using Excel Add-in Development in C/C++ is a must-buy book for any serious Excel developer.Excel is the industry standard for financial modelling, providing a number of ways for users to extend the functionality of their own add-ins, including VBA and C/C++. This is the only complete how-to guide and reference book for the creation of high performance add-ins for Excel in C and C++ for users in the finance industry. Steve Dalton explains how to apply Excel add-ins to financial applications with many examples given throughout the book. It also covers the relative strengths and weaknesses of developing add-ins for Excel in VBA versus C/C++, and provides comprehensive code, workbooks and example projects on the accompanying CD-ROM. The impact of Excel 2007’s multi-threaded workbook calculations and large grids on add-in development are fully explored. Financial Applications using Excel Add-in Development in C/C++ features:
Extensive example codes in VBA, C and C++, explaining all the ways in which a developer can achieve their objectives.
Example projects that demonstrate, from start to finish, the potential of Excel when powerful add-ins can be easily developed.
Develops the readers understanding of the relative strengths and weaknesses of developing add-ins for Excel in VBA versus C/C++.
A CD-ROM with several thousand lines of example code, numerous workbooks, and a number of complete example projects.
CD Not Included!
Preface to Second Edition.
Preface to First Edition.
Acknowledgements for the First Edition.
Acknowledgements for the Second Edition.
Typographical and code conventions used in this book.
What tools and resources are required to write add-ins.
To which versions of Excel does this book apply?
The future of Excel: Excel 2007 (Version 12).
About add-ins.
Why is this book needed?
How this book is organised.
Scope and limitations.
Excel Functionality.Overview of Excel data organisation.
A1 versus R1C1 cell references.
Cell contents.
Worksheet data types and limits.
Excel input evaluation.
Data type conversion.
Strings.
Excel Terminology: Active and Current.
Commands versus functions in Excel.
Types of worksheet function.
Complex functions and commands.
Excel recalculation logic.
The Add-in Manager.
Loading and unloading add-ins.
Paste function dialog.
Good spreadsheet design and practice.
Problems with very large spreadsheets.
UsingVBA.Opening the VB editor.
Using VBA to create new commands.
Assigning VBA command macros to control objects in a worksheet.
Using VBA to trap Excel events.
Using VBA to create new functions.
Using VBA as an interface to external DLL add-ins.
Excel ranges, VB arrays, SafeArrays, array Variants.
Commands versus functions in VBA.
Creating VB add-ins (XLA files).
VBA versus C/C++: some basic questions.
Creating a 32-bit Windows (Win32) DLL Using Visual C++ 6.0 or Visual Studio.NET.Windows library basics.
DLL basics.
DLL memory and multiple DLL instances.
Multi-threading.
Compiled function names.
Function calling conventions: _cdecl, _stdcall, _fastcall.
Exporting DLL function names.
What you need to start developing add-ins in C/C++.
Creating a DLL using Visual C++ 6.0.
Creating a DLL using Visual C++.NET 2003.
Accessing DLL functions from VB.
Accessing DLL functions from excel.
Turning DLLs into XLLs: The Add-in Manager Interface.The Xlcall32 library and the C API functions.
What does the Add-in manager do?
Creating an XLL: The xlAuto interface functions.
When and in what order does Excel call the XLL interface functions?
XLL functions called by the Add-in Manager and Excel.
Passing Data Between Excel and the DLL.Handling Excel’s internal data structures: C OR C++?
How Excel exchanges worksheet data with DLL add-in functions.
Defining constant xlopers/xloper12s.
A C++ class wrapper for the xloper/xloper12 – cpp_xloper.
Converting between xloper/xloper12s and C/C++ data types.
Converting between xloper/xloper12 types.
Converting between xlopers and variants.
Converting between xlopers and xloper12s.
Detailed Discussion of xloper types.
Initialising xloper/xloper12s.
Missing arguments.
Memory Management.Excel stack space limitations.
Static add-in memory and multiple Excel instances.
Getting Excel to free memory allocated by Excel.
Getting Excel to call back the DLL to free DLL-allocated memory.
Returning data by modifying arguments in place.
Making add-in functions thread safe.
Accessing Excel Functionality using the C API.The Excel 4 macro language (XLM).
The Excel4(),Excel12() C API functions.
The Excel4v()/Excel12v() C API functions.
What C API functions can the DLL call and when?
Wrapping the C API.
Registering and un-registering DLL (XLL) functions.
Registering and un-registering DLL (XLL) commands.
Functions defined for the C API only.
Working with binary names.
Workspace information commands and functions.
Working with Excel names.
Working with Excel menus.
Working with toolbars.
Working with custom dialog boxes.
Trapping events with the C API.
Miscellaneous commands and functions.
The XLCallVer() C API function.
Miscellaneous Topics.Timing function execution in VBA and C/C++.
Relative performance of VBA, C/C++: Tests and results.
Relative performance of C API versus VBA calling from a worksheet cell.
Detecting when a worksheet function is called from an Excel dialog.
Accessing Excel functionality using COM/OLE automation using C++.
Maintaining large data structures within the DLL.
A C++ Excel name class example, xlName.
Keeping track of the calling cell of a DLL function.
Passing references to Excel worksheet functions.
Multi-tasking, Multi-threading and asynchronous calls in DLLS.
A background task management class and strategy.
How to crash Excel.
Add-in Design.
Separating interface code from core function code.
Controlling error propagation.
Making add-in behaviour Excel version-sensitive and backwards-compatible.
Version-dependent workbook recalculation results.
Optimisation.
Example Add-ins and Financial Applications.String functions.
Statistical functions.
Matrix functions – eigenvalues and eigenvectors.
Interpolation.
Lookup and search functions.
Financial markets date functions.
Building and reading discount curves.
Building trees and lattices.
Monte carlo simulation.
Calibration.
CMS derivative pricing.
The SABR stochastic volatility model.
Optimising the SABR implementation for CMS derivatives.
Appendix
1. Contents of the CD ROM.
Related Reading.
Web Links and Other Resources.