Gets the number of bytes of remaining stack space
[C++]
static USHORT XlGetStackSpace();
Returns the number of bytes of stack space available.
Excel has a limited amount of stack space available for use by add-in functions.
The XLL+ classes have been designed to make optimal use of the stack, and any
very large data requirements are allocated on the heap and automatically cleaned up. However, if your code needs very large amounts of stack space (for instance in a
recursive algorithm), then you should check that sufficient stack space is
available for your code to run, by periodically calling
XlGetStackSpace(). 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:
USHORT usBytes = CXllApp::XlGetStackSpace();
Header: xllplus.h