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
 

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