Yuri
See my answer to Sergey ( i used by mistake XLS instead of XL5 in the export ).
To answer your question in the other message, i am using of course the Value property of the cells to bring back the results. I broke my replace in many replace clauses ( one for each field ) and that's how i found the dates were causing the mismatch in the first place.
Now the puzzling thing remains the empty dates: in the debugger, vartype(.Cells(x,y).Value ) is T for the date fields but C if the date is empty!!
Jaime
>>Ok i see what's happening now.
>>When i export to excel, the date fields get formatted as in the default for excel, in my case in format "Mar 8, 2006". I tried running .Range('S:S').NumberFormat='dd-mm-yyyy' for the date fields, but then i just saw in the debugger they come as "08-Mar-2006", so the CTOD on this fails ( it just gives me empty dates now ).
>>
>>Jaime
>>
>
>Sorry, but it is very strange. Formatting means how the information is presented/displayed, still its VALUE should remain as is (if you/user do not touch it).
>
>?OExcel.Activesheet.Cells(2,1).value && time datatype, 03/08/2006 ....
>?OExcel.Activesheet.Cells(2,1).text && TEXT datatype, "08-Mar-2006"
Why do programs stop working correctly as soon as you leave the Fox?