XLL+ Class Library

CXllApp::IsInFormulaWizard

Is Excel currently showing the Formula Wizard ?

[C++]
static BOOL IsInFormulaWizard();

Return value

TRUE if the current add-in function is being called from the Excel Function Wizard; FALSE otherwise.

Remarks

If your function is expensive to perform, or may involve user interaction, it is not a good idea to call it from the Excel Function Wizard, as it will be called each time one the arguments are changed. You can use this function to detect the condition and return a safe, cheap result.

Since this function is static, it is not necessary to use an instance of CXllApp to invoke it. It is not therefore necessary to fix the MFC CWinApp instance using the XLL_FIX_STATE macro: you can use code such as:

    if ( CXllApp::IsInFormulaWizard()) 
    {
        xloRet = xlerrNA;
        return xloRet.Ret();
    }

Automating the code

You can use the XLL+ Function Wizard to generate this code for you automatically. See Disabled in Excel Formula Wizard command.

Requirements

Header: xllplus.h

See Also

CXllApp Class | CXllApp Methods | Function attribute: nopreview | Disabled in Excel Formula Wizard command