Question: I'm working with calendar data exported from Outlook. For some reason, Outlook exports the data as text, not a date/time variable, so I need to convert the data to date/time before I can work with it.
I tried the following:
Private Sub Clean1_Click()
Dim datStartDate2 As Date
Dim strStartDate As String
StartDate.SetFocus
strStartDate = StartDate.Text
datStartDate2 = CDate(strStartDate)
StartDate2.SetFocus
StartDate2.Text = datStartDate
End Sub
but keep coming up with a type mismatch error.
I also tried DateValue instead of CDate but still got a type mismatch error.
I've tried dim-ing datStartDate2 as Date and as Var but still get that error.
Any suggestions?