Here is a function that works for me
Private Function GetNumDays (StartDate As Date, EndDate As Date ) As Integer
EndDate = EndDate.AddDays(1)
Dim NumDays As Integer = 0
While StartDate < EndDate
NumDays+=1
StartDate = StartDate.AddDays(1)
End While
Return NumDays
End Function