CopyFromRecordset fails if more than 911 byte in a field

J

JesperT

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top