I have many users for this program who are now moving to excel 2010. Since in Excel 2010 the calendar control uses the vba syntax of ufCalendar.Calendar1, where as in Excel 2007 it is ufCalendar.Calendar, I would need to test for what version is running. so this code should do the trick. (it's an event handler, ufCalendar is the name of the calendar form)
But lo and behold I get a compile error because right now I'm using 2010 and it doesn't recognize the ufCalendar.Calendar. I tried andding On Error Resume Next everywhere in this routine but it still won't work. I need a solution, help!
Code:
Private Sub tbStartDate_Enter()
If Application.Version = "14.0" Then
Load ufCalendar
ufCalendar.Show
Me.tbStartDate.Value = ufCalendar.Calendar1.Value
Else
Load ufCalendar
ufCalendar.Show
Me.tbStartDate.Value = ufCalendar.Calendar.Value
End If
End Sub
But lo and behold I get a compile error because right now I'm using 2010 and it doesn't recognize the ufCalendar.Calendar. I tried andding On Error Resume Next everywhere in this routine but it still won't work. I need a solution, help!