View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
JesperT JesperT is offline
external usenet poster
 
Posts: 1
Default CopyFromRecordset fails if more than 911 byte in a field


Using ADO (ActiveX 2.8 Object Lib) with Excel 2003, I extract data from a
worksheet and copy it to another worksheet in the same workbook.
In Office 2007 everything is fine, but in Office XP and Office 2003 the
CopyFromRecordset fails if a field has more than 911 bytes.

Here is a snippet of my code:
If rs2.EOF = True Then
wsExe.Range("B3").Value = "No Data found with selected Criteria"
Else
formatcolumn wsExe 'make sure we can store memo size fields
On Error GoTo 0
wsExe.Range("A3").CopyFromRecordset rs2
End If

The CopyFromRecordset instruction fails, and doesn't give any errors, just
simply exit the entire Sub. (i.e. doesn't even reach the End If)

Apart from splitting column's which 'potentially' can have large amount of
text, does anyone have a 'proper' solution for this.