XLL+ Class Library (6.3)

CXlDate::StringToSerial

Transform a string to a serial date

static double StringToSerial(
   const TCHAR* str
);

Parameters

str

A string containing a date. Excel will use the date formatting rules currently in force to read the string.

Return Value

An Excel serial date value.

Remarks

This function calls Excel's DATEVALUE() function to transform a string date into its components.

Because it uses Excel for the transformation, it handles variations in the Excel base date transparently.

Exceptions

If a call to the Excel API fails, then an exception of type CXlApiException will be thrown. Since this exception is derived from CXlRuntimeException, it will be caught by the add-in wrapper function when this method is called from within an add-in function.

Requirements

Header: xlldate.h

See Also

CXlDate Class | CXlDate Methods