Reference: Q0002
Article Last Modified on 01-Jun-2002
When an XLL+ function with no arguments is displayed in the Excel Formula Wizard, the following message is displayed.
This occurs even when a help string for the function has been defined using the XLL+ Function Wizard.No help available.
We consider the first behaviour - displaying no help - to be less bad than the second behaviour - displaying a misleading prompt.
In the module's InitInstance() function, call something like the following:
FindFn("NoArgs_VersionInfo")->m_stArgNames = " ";
The trick here is to convince the XLL+ run-time that there are
some arguments to the function, thereby triggering the second class of
behaviour.
The argument to FindFn() should be the exported (Excel) function name. The string assigned, as the right-hand-side value, should be a single blank: " ".
It is essential that the work-around be called after the call to AddStaticFns(). For example:
BOOL CNoArgsApp::InitInstance()
{
// Call the base class
if ( !CXllApp::InitInstance() )
return FALSE;
// Set the name of the library to the default value
m_stName = m_pszDefName;
// Add the statically defined function specifications
AddStaticFns();
// TODO: Add your specialized code here
FindFn("NoArgs_VersionInfo")->m_stArgNames = " ";
return TRUE;
}