I am having a strange problem with a routine in Access that is writing a recordset out to a spreadsheet. Most of my recordset is exporting fine, but I have two particular records whose text fields are not been written to the cell properly and when you open the spreadsheet you see the #VALUE! error in the cell.

Code fragment follows:
VB Code:
  1. debug.print rstGenericImport.RecordCount
  2. 'ok at this point I can verify that all my records have been included...
  3.  
  4. While Not rstGenericImport.EOF
  5.                 With excelWS.Cells(rowCounter, 5)
  6.                    Debug.Print rstGenericImport!test_script
  7. 'stepping thru the code I can hold my mouse over the above line and see 'that my text value is ready to be written into the spreadsheet cell...
  8.  
  9.              'even though I can see it at the following line in the spreadsheet
  10.              'it will have the #VALUE! error in the cell
  11.  
  12.                     .Value = rstGenericImport!test_script
  13.                    
  14.                     .Font.Size = 8
  15.                     .Font.Bold = False
  16.                     .Font.Name = "Verdana"
  17.                     .Font.Italic = False
  18.                     .WrapText = True
  19.                     .ShrinkToFit = True
  20.                     .HorizontalAlignment = xlLeft
  21.                     .VerticalAlignment = xlTop
  22.                 End With
  23.  
  24. '...rest of the loop...

The field is of type MEMO by the way. As I mentioned before there are only two records where this is occurring, the rest write the values into the cell correctly.

If anybody has some ideas I would be very appreciative as its got me beat for the moment. Thanks