1. Trang chủ
  2. » Công Nghệ Thông Tin

Excel add in development in c and c phần 1 pps

43 323 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 43
Dung lượng 449,51 KB

Nội dung

[...]... worksheet cell: xltypeNil 6.8 .10 Worksheet binary name: xltypeBigData 92 94 95 95 95 95 96 96 96 97 98 98 99 99 10 0 10 1 10 2 10 3 10 5 10 5 10 5 10 6 10 7 11 1 11 8 11 8 11 9 12 1 12 1 12 6 12 6 12 7 13 0 13 1 13 2 13 5 13 8 14 0 14 2 14 5 15 0 15 5 15 7 Contents 6.9 6 .10 Initialising xlopers Missing arguments ix 15 7 16 0 7 Memory Management 7 .1 Excel stack space limitations 7.2 Static add- in memory and multiple Excel instances 7.3... sub-menu: xlfAddMenu 8 .11 .6 Adding a command to a menu: xlfAddCommand 8 .11 .7 Displaying a custom menu bar: xlfShowBar 8 .11 .8 Adding/removing a check mark on a menu command: xlfCheckCommand 8 .11 .9 Enabling/disabling a custom command or menu: xlfEnableCommand 8 .11 .10 Changing a menu command name: xlfRenameCommand 8 .11 .11 Deleting a command from a menu: xlfDeleteCommand 8 .11 .12 Deleting a custom menu:... Functions defined for the C API only 8.7 .1 Freeing Excel- allocated memory within the DLL: xlFree 16 9 16 9 17 0 17 1 17 1 17 1 17 3 17 4 17 6 17 8 17 8 18 0 18 2 18 3 18 5 18 6 18 8 18 9 18 9 19 0 19 1 19 1 19 1 19 4 19 5 19 6 19 8 19 9 19 9 19 9 x Contents 8.7.2 8.7.3 8.7.4 8.7.5 8.7.6 8.7.7 8.8 8.9 8 .10 Getting the available stack space: xlStack Converting one xloper type to another: xlCoerce Setting cell values from a command:...viii Contents 4 .11 4 .12 Accessing DLL functions from VB Accessing DLL functions from Excel 5 Turning DLLs into XLLs: The Add- in Manager Interface 5 .1 Adding the Excel library and header files to a DLL project 5.2 What does the Add- in Manager do? 5.2 .1 Loading and unloading installed add- ins 5.2.2 Active and inactive add- ins 5.2.3 Deleted add- ins and loading of inactivate add- ins 5.3 Creating an XLL:... Getting Excel to free memory allocated by Excel 7.3 .1 Freeing xloper memory within the DLL call 7.3.2 Freeing xloper memory returned by the DLL function 7.4 Getting Excel to call back the DLL to free DLL-allocated memory 7.5 Returning data by modifying arguments in place 16 1 16 1 16 2 16 2 16 3 16 4 16 6 16 8 8 Accessing Excel Functionality Using the C API 8 .1 The Excel 4 macro language (XLM) 8 .1. 1 Commands,... Automation using C+ + 9.5 .1 Initialising and un-initialising COM 9.5.2 Getting Excel to recalculate worksheets using COM 9.5.3 Calling user-defined commands using COM 9.5.4 Calling user-defined functions using COM 9.5.5 Calling XLM functions using COM 9.5.6 Calling worksheet functions using COM 9.6 Maintaining large data structures within the DLL 9.7 A C+ + Excel name class example, xlName 9.8 Keeping track of... Applications 10 .1 String functions 10 .2 Statistical functions 10 .3 Matrix functions – eigenvalues and eigenvectors 10 .4 Interpolation functions: lines, curves and splines 10 .5 Lookup and search functions 10 .6 Financial markets date functions 10 .7 Building and reading discount curves 10 .8 Building trees and lattices 10 .9 Quasi-random number sequences 10 .10 Generating correlated random samples 10 .11 Monte Carlo... A1 and R 1C1 style comparisons A1 style R 1C1 style Row-column order Column then row Row then column Top row in sheet 1 R1 Bottom row in sheet 65536 R65536 (continued overleaf ) 10 Excel Add- in Development in C/ C++ Table 2.2 (continued ) A1 style R 1C1 style Left-most column in sheet A C1 Right-most column in sheet IV C2 56 Relative reference style as shown by formula =A2 entered into cell B1 =A2 =R [1 ]C[ -1] ... 213 214 214 215 215 215 217 2 21 2 21 222 225 227 233 234 234 235 236 237 239 239 2 41 2 41 242 244 245 247 248 Contents 8 .11 8 .12 8 .13 8 .14 Working with Excel menus 8 .11 .1 Menu bars and ID numbers and menu and command specifiers 8 .11 .2 Short-cut (context) menu groups 8 .11 .3 Getting information about a menu bar: xlfGetBar 8 .11 .4 Creating a new menu bar or restoring a default bar: xlfAddBar 8 .11 .5 Adding... simulation 10 .11 .1 Using Excel and VBA only 10 .11 .2 Using Excel and C/ C++ only 10 .11 .3 Using worksheet functions only 10 .12 Calibration 335 335 344 3 51 353 357 363 3 71 374 374 375 376 377 379 3 81 3 81 References 383 Web Links and Other Resources 385 Index 387 Preface This book is intended to provide the reader with a guide to the issues involved with creating powerful and reliable add- ins for Excel With . write add- ins 2 1. 2 .1 VBA macros and add- ins 3 1. 2.2 C/ C++ DLL add- ins 3 1. 2.3 C/ C++ DLLs that can access the C API and XLL add- ins 4 1. 2.4 C/ C++ /C# .NET add- ins 4 1. 3 To which versions of Excel. 374 10 .10 Generating correlated random samples 375 10 .11 Monte Carlo simulation 376 10 .11 .1 Using Excel and VBA only 377 10 .11 .2 Using Excel and C/ C++ only 379 10 .11 .3 Using worksheet functions. check mark on a menu command: xlfCheckCommand 260 8 .11 .9 Enabling/disabling a custom command or menu: xlfEnableCommand 262 8 .11 .10 Changing a menu command name: xlfRenameCommand 263 8 .11 .11 Deleting

Ngày đăng: 09/08/2014, 16:20

Nguồn tham khảo

Tài liệu tham khảo Loại Chi tiết
2.6.7 Conversion of single-cell referencesExcel will convert a single-cell reference to the value of the cell referred to, unless it is being passed to a function that expects a reference as its parameter rather than a value.(Later chapters go into detail on such functions, but a simple example is ROW() , which extracts and returns the row number of a cell reference.) If an operator or function using the reference requires a different data type than that of the reference’s value, then Excel will also attempt to convert to the required type. (See next section for more detail.) For example, if a cell contains the formula =SUM(A1,B1) , with A1 containing the number 123 and B2 the string "456" , Excel will convert the reference A1 to the value of that cell, 123, and the reference B1 to the string "456" and then to the argument type expected by SUM() , the number 456 , leading finally to a result of 579 Sách, tạp chí
Tiêu đề: 456", Excel will convert the referenceA1to the value of that cell, 123,and the referenceB1to the string"456
2.6.9 Conversion of defined range namesWhere a cell formula contains a token that cannot be interpreted as a constant (either numeric or string within double-quotes) or a cell reference, Excel searches for a named range on the current sheet and then the current workbook. (See below for an explanation of the term current.) Sách, tạp chí
Tiêu đề: current
2.6.12 Operator evaluation precedence Table 2.9 Operator evaluation precedenceOperators (operation) NotesName lookup and substitutionReference-to-value and type conversion() and worksheet functions Evaluated left to right%, unary –ˆ =4^50% evaluates to 2*/Binary +−& =4+2&1+5="66" evaluates to TRUE Binary = , < , > , <= , >= , <> Evaluated left to right Sách, tạp chí
Tiêu đề: 66
2.7 EXCEL TERMINOLOGY: ACTIVE AND CURRENTExcel functions that provide information about a cell, a range of cells or a sheet in a workbook often make a distinction between the workbook, sheet or cell that the user is currently looking at, and the workbook, sheet or cell from which the function was called. 1 The same is true of commands that affect a workbook or one of its constituents. The terms active and current are used to make the distinction, which can be quite confusing. Here is a clear definition Sách, tạp chí
Tiêu đề: active"and "current
2.8 COMMANDS VERSUS FUNCTIONS IN EXCELThere is an important distinction in Excel between functions, represented by formulae in worksheet cells that may or may not take arguments but always return a value, and commands which are equivalent to a user doing something. For example, NOW() is a function: it returns a number representing the date and time right now. In contrast, the action taken by Excel to format a cell when a user presses a formatting icon on a toolbar is a command.1 There are other components that can be active, e.g., components of a chart that have been selected, which are not covered here Sách, tạp chí
Tiêu đề: always
2.6.8 Conversion of multi-cell range referencesSome functions will work equally well with single cell references and range references, for example, SUM(A1,B1,C1) gives the same result as SUM(A1:C1) . In the latter case, the SUM() function converts the range A1:C1 to a mixed type array of values and then iterates through that converting and summing values where possible. The work of handling the range argument is done within the code of the SUM() function Khác
2.6.10 Explicit type conversion functions: N() , T() , TEXT() , VALUE()Explicit type conversion is possible with the functions VALUE() and TEXT() with the advan- tage that TEXT() provides control over the text format where an implicit conversion does not. Type conversion can also be constrained with the functions N() and T() . Table 2.7 summarises the action of these functions on the basic data types Khác
2.6.11 Worksheet function argument type conversionExcel will attempt to convert arguments being passed to functions, regardless of whether they are Excel’s built-in worksheet functions, a third party’s add-in functions or user-defined VB functions. Worksheet functions can take as arguments any combination of the following Khác

TỪ KHÓA LIÊN QUAN