[Include]
IsGregYear

[CODE]
Public Function GetMonthDays(ByVal xYear As Long, ByVal xMonth As Long) As Long
  Select Case xMonth
    Case 1&, 3&, 5&, 7&, 8&, 10&, 12&
      GetMonthDays = 31&
    Case 2&
      GetMonthDays = 28& - CLng(IsGregYear(xYear))
    Case 3&, 5&, 9&, 11&
      GetMonthDays = 31&
    End Select
  End Function