Len Holgate gave the correct answer to find out the version number of Excel in use. Here's some sample code:
xloper xlstrVersion, xlintVersion, xlintParam;
// supply a parameter with value 2 to read the Excel version number as a string
xlintParam.xltype = xltypeInt;
xlintParam.val.w = 2;
int xlret = Excel4(xlfGetWorkspace, &xlstrVersion, 1, &xlintParam);
// now use the xlCoerce function to convert the version string to an integer
xlintParam.val.w = xltypeInt;
xlret = Excel4(xlCoerce, &xlintVersion, 2, &xlstrVersion, &xlintParam);
const int ExcelVersion = xlintVersion.val.w;
const bool ExcelVersion12Plus = ExcelVersion >= 12;
If you only need to distinguish Excel version 12 from earlier versions, then use the XLCallVer function as follows:
const bool ExcelVersion12Plus = (0x0c00 == XLCallVer());