This is, in all likelihood, a stupid question, but…in an VB6 macro for Excel 2003, why does the following code return a type mismatch error if the cell (E, ActiveCell.row) is formatted as “Date (m/d/yy)”, and contains the data “10/2/2006” (without the quotes)?
Dim EnrollDate as Date
EnrollDate = Cells("E", ActiveCell.row).Value
I have also tried using “EnrollDate = Cells(“E”, ActiveCell.row).Text”, but that returns a type mismatch as well.
I’ve never had a problem getting VB to accept dates in this format before, so I figure I’m doing something wrong with my assignment statement (I don’t usually work in Excel). Can anyone help me out?
ETA: I also tried formatting the cell as plain text rather than a date. That didn’t work either.