XLL+ Class Library (6.3)

Automating the code

Using the Function Wizard

An alternative method of implementing the CXllApp::IsInFormulaWizard() method uses the XLL+ Function Wizard.

In the XLL+ Function Wizard, go to the Features tab, and put a check against Do not call in Formula Wizard, as shown below:

This will change your wrapper functions to include code like the following:

CopyC++
extern "C" __declspec(dllexport)
LPXLOPER4 SLOWCALC_4(double X, double Y)
{
    XLL_FIX_STATE;
    CXlOper xloResult;
    if (CXllApp::IsInFormulaWizard())  
    {                                  
        xloResult = xlerrNA;           
        return xloResult.Ret4();       
    }                                  
    try {
        xloResult.HandleResult(SLOWCALC_Impl(xloResult, X, Y));
    }
    catch(const CXlRuntimeException& ex) {
        CXllApp::Instance()->DisplayException(xloResult, ex);
    }
    return xloResult.Ret4();
}

The common function that contains your code, SLOWCALC_Impl(), will never be called. The wrapper function will quit as soon as it discovers that it's being called from the Formula Wizard.

Using the ToolWindow

You can make the same change to your function by using the XLL+ ToolWindow. Select the function to be edited and, in the Properties window, change the value of Do not call in Formula Wizard to True.

Next: Previewing the Excel Formula Wizard >>