12.07.2015 Views

Excel Add-in Development in C/C++: Applications in ... - F9

Excel Add-in Development in C/C++: Applications in ... - F9

Excel Add-in Development in C/C++: Applications in ... - F9

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

34 <strong>Excel</strong> <strong>Add</strong>-<strong>in</strong> <strong>Development</strong> <strong>in</strong> C/<strong>C++</strong>2.14.1 Function categoryIn the left-hand list box are all the function categories, the top two be<strong>in</strong>g special categorieswith obvious mean<strong>in</strong>gs. All functions are otherwise listed under one and only one specificcategory. Many of these categories are hard-coded <strong>Excel</strong> standards. <strong>Add</strong>-<strong>in</strong>s can addfunctions to exist<strong>in</strong>g categories or can create their own, or do both. If functions havebeen def<strong>in</strong>ed <strong>in</strong> a VB module or have been loaded by the <strong>Add</strong>-<strong>in</strong> Manager from an XLAadd-<strong>in</strong> file, then the category UDF (<strong>in</strong> <strong>Excel</strong> 2000) or User Def<strong>in</strong>ed (<strong>in</strong> <strong>Excel</strong> 2002 andlater) appears and the functions are listed under that.2.14.2 Function name, argument list and descriptionSelect<strong>in</strong>g a category will cause all the functions <strong>in</strong> that category to be listed <strong>in</strong> alphabeticalorder <strong>in</strong> the right-hand list box. The figure shows the Logical category selected and allsix logical functions. Select<strong>in</strong>g a function name causes the name as it appears <strong>in</strong> thespreadsheet, a named comma-separated argument list and a description of the functionto be displayed below the list boxes. In the above example the arguments and functiondescription for the IF() function are shown.2.14.3 Argument construction dialogPress<strong>in</strong>g OK <strong>in</strong> the Paste Function dialog causes the argument construction dialog toappear for the highlighted function. Invok<strong>in</strong>g the Paste Function command on an activecell conta<strong>in</strong><strong>in</strong>g a function has the same effect. The figure below shows this for the IF()function. Where <strong>in</strong>voked on an empty cell the dialog is blank. Where <strong>in</strong>voked on anexist<strong>in</strong>g formula, the fields are populated with the expressions read from the cell’s formula.This dialog has a number of important features that should be understood by anyonewant<strong>in</strong>g to enable users to access their own add-<strong>in</strong> functions <strong>in</strong> this way. These arehighlighted <strong>in</strong> the follow<strong>in</strong>g diagram which shows the <strong>Excel</strong> 2000 dialog.12345Figure 2.5 Paste Function argument construction dialog (<strong>Excel</strong> 2000)(1) Argument name – from the argument list <strong>in</strong> the Paste Function dialog. (Bold type<strong>in</strong>dicates a required argument; normal type, an optional one.)(2) Argument expression text box – <strong>in</strong>to which the user enters the expression that <strong>Excel</strong>evaluates <strong>in</strong> preparation for the function call.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!