Excel copyfromrecordset fails with large DAO recordset

M

MacDermott

I'm using automation to copy data from Access (2003) to Excel.
Most of the time, this works fine, but occasionally when I have a large
recordset, I get "Method 'CopyFromRecordset' of 'Range' object failed."
When I examine the recordset in question, its AbsolutePosition is always at
512, so I'm guessing that perhaps the entire recordset has not been
generated/populated by the time the CopyFromRecordset method is called.
I added rst.MoveLast and rst.MoveFirst, to try to force the recordset to
populate first, but that doesn't seem to be enough.

Any ideas?
TIA
 
Top