Code Snippets

CopyFromRecordset (Excel)

This method will fail if the recordset contains any OLE objects

Worksheets("Sheet1").Range("A1").CopyFromRecordset objADORecordset 

You can quickly transfer an ADO or DAO recordset to an Excel range by using the CopyFromRecordset method.
In Excel 97 this method is only available from a DAO recordset.
To transfer from an ADO recordset in Excel 97 you can use the GetRows method to create an array.

© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrev