It isn't always possible to get the function definition right the first time around. You may need to go back and change details of a function's specification. For example, you may want to:
The Function Wizard can do all of these tasks and many more. The Function Wizard can read the code that it generates, so that you can edit a definition you have previously created.
Let's revisit our historical volatility calculator, and let the user specify the number of business days in a year. In our first implementation, we hard-coded this to 250.
To fix the problem, we need to revisit the function definition using the Function Wizard. In DevStudio, put the cursor somewhere in the body of the HISTVOL() function and click on the XLL+ Function Wizard tool.
(In Visual Studio .NET or Visual Studio 2005, use the XLL+ Function Wizard item on the Tools menu.)
The Function Wizard will appear, with the HISTVOL function definition displayed. If another function is displayed instead, use the 'C' Name combo box to select HISTVOL, as shown below
You can now make any changes you need to the function and, when you press OK, the code in your source file will be regenerated.
Note: only code between the //{{XLP_SRC delimiters will be overwritten. Any code which you have added outside the delimiters will be unaffected.
In the arguments grid, go to the Name column of the last line and type in the name of the argument, DaysPerYear.
Fill in the argument's columns as follows:
Name: DaysPerYear Type: Double Dimensions: Scalar Description: Number of samples per year
After you add the argument, the Function Wizard should look like this:
Click on the OK button to dismiss the Wizard and update the source code.