I am kind of confused, I was following the "Excel 2013 SDK" documentation, and bein interested in User defined Asynchronous functions. Here is my simplest example, it doesn't even do anything:
// registration
{ L"Func5", // Procedure
L">QX", // void return >;
L"Func5", // function_text; The function name as it will appear in the Function Wizard
L"Arg", // argument_text; The user sees this in the Function
L"1", // macro_type; "1" can be called from anywhere; listed everywhere
L"Generic Add-In", // category
L"", // shortcut_text; A one-character, case-sensitive string that specifies the control key assigned to this
L"", // help_topic
L"Sig: >QX", // function_help
L"Argument ignored" // argument_help1
},
// ...
__declspec(dllexport) void WINAPI Func5(LPXLOPER12 x, LPXLOPER12 asyncHandle)
{
switch (x->xltype)
{
case xltypeNum:
{
// just break, not doing anything
break;
}
default: break;
}
return;
}
This compiles fines and Excel loads it correctly, but as soon as I type "=func5()" the whole UI freezes, and waits for me to do anything; then shows "#Calc!".
I am fine with the error, but what's even the point of Async functions if the UI freezes? Am I doing something wrong?
=func5()puts the return value in the cell. What value are you returning?