ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   CopyFromRecordset fails if more than 911 byte in a field (https://www.excelbanter.com/excel-programming/422052-copyfromrecordset-fails-if-more-than-911-byte-field.html)

JesperT

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.




All times are GMT +1. The time now is 02:13 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com