|
-
Mar 20th, 2006, 07:08 PM
#1
Thread Starter
Member
[RESOLVED] #VALUE! message in Excel cell
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
-
Mar 20th, 2006, 10:36 PM
#2
Thread Starter
Member
Re: [RESOLVED] #VALUE! message in Excel cell
Ok, I solved this issue by assigning the text value from the recordset to a string variable, and then using that to write to the spreadsheet cell. However, I still don't know why it was not working before, and why it was only a couple of records in my database, but... <<shrugs shoulders dismissively>>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|