XLL+ Class Library (6.3)

CXlDate::XlWeekday

Convert a date to a day of the week

static int XlWeekday(
   long date
);

Parameters

date

An integer serial date value.

Return Value

An integer between 1 (Monday) and 7 (Sunday).

Remarks

This function calls Excel's WEEKDAY() function with 2 as its second argument.

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