Range.CopyFromRecordset Method
Copies the contents of an ADO or DAO Recordset object onto a worksheet, beginning at the upper-left corner of the specified range.
Namespace: Microsoft.Office.Interop.Excel
Assembly: Microsoft.Office.Interop.Excel (in microsoft.office.interop.excel.dll)
Assembly: Microsoft.Office.Interop.Excel (in microsoft.office.interop.excel.dll)
int CopyFromRecordset( [In] object Data, [In, Optional] object MaxRows, [In, Optional] object MaxColumns );
public int CopyFromRecordset( /*in*/System.Object Data, /*in*/System.Object MaxRows, /*in*/System.Object MaxColumns );
function CopyFromRecordset( Data : Object, MaxRows : Object, MaxColumns : Object ) : int;
Parameters
- Data
Required Object. The Recordset object to copy into the range.
- MaxRows
Optional Object. The maximum number of records to copy onto the worksheet. If this argument is omitted, all the records in the Recordset object are copied.
- MaxColumns
Optional Object. The maximum number of fields to copy onto the worksheet. If this argument is omitted, all the fields in the Recordset object are copied.