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:
debug.print rstGenericImport.RecordCount 'ok at this point I can verify that all my records have been included... While Not rstGenericImport.EOF With excelWS.Cells(rowCounter, 5) Debug.Print rstGenericImport!test_script '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... 'even though I can see it at the following line in the spreadsheet 'it will have the #VALUE! error in the cell .Value = rstGenericImport!test_script .Font.Size = 8 .Font.Bold = False .Font.Name = "Verdana" .Font.Italic = False .WrapText = True .ShrinkToFit = True .HorizontalAlignment = xlLeft .VerticalAlignment = xlTop End With '...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




Reply With Quote