được liệt kê dưới đây, sử dụng xlSheetId chức năng API C-chỉ để có được ID của bảng hoạt động. Lưu ý rằng ID này không giống như tài sản Index. Ví dụ VBA ở trên, mà chỉ đơn giản là chỉ mục trong bộ sưu tập của tờ bảng tính của | Example Add-ins and Financial Applications 505 Prototype 2003 xloper stdcall get_discount_value_xl4 char curve_ref double date xloper rtn_type 2007 xloper12 stdcall get_discount_value_xl12 wchar_t curve_ref double date xloper12 rtn_type Type string RCBP 2003 UC BQ 2007 Notes Returns the discount function or other curve data at the given date depending on the optional rtn_type argument or an error value. The above is a minimal set of curve functions. Others can easily be imagined and implemented such as a function that returns an array of discount values corresponding to an array of input dates or a function that calculates a forward rate given two dates and a day-basis. Functions that price complex derivatives can be implemented taking only a reference to a curve and to the data that describe the derivative without the need to retrieve and store all the associated discount points in a spreadsheet. BUILDING TREES AND LATTICES The construction of trees and lattices for pricing complex derivatives raises similar issues to those involved in curve-building. For simplicity the term tree is used for both trees and lattices. In both cases decisions need to be made about whether or not to use a remote server. If the decision is to use a server the same issues arise regarding how to inform dependent cells on the worksheet that the tree has changed and how to retrieve tree information. See the above section for a brief discussion of these points. If the decision is to create the tree locally then the model of one function that creates the tree and returns a reference for tree-dependent cells to refer to works just as well for trees as for discount curves. There is however a new layer of complexity compared to curve building whereas an efficient curve-building routine will be quick enough to run in foreground simple enough to be included in a distributed add-in and simple enough to have all its inputs available locally in a user s workbook the same might not be true of a