I've just checked my code and can't see anything obvious, so I would assume that the values could not be converted into times.
Therefore I would recommend using a bit of validation, possibly like this:
If you still get an error, you should let me know which line it occurs on, and what the text values are.VB Code:
Dim sTime as String Dim sTempTime as String With MSFlexGrid1 sTime = "0:00:00" sTempTime = Format$(.TextMatrix(r, firstcol),"####0:00:00") If IsDate(sTempTime) Then sTime = sTime + CDate(sTempTime) sTempTime = Format$(.TextMatrix(r, secondcol),"####0:00:00") If IsDate(sTempTime) Then sTime = sTime + CDate(sTempTime) If Left$(sTime,2) = "::" Then sTime = Mid$(sTime,2) .TextMatrix(r, totalcol) = sTime End With




Reply With Quote