Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

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)

'Usage
Dim Data As Object
Dim MaxRows As Object
Dim MaxColumns As Object
Dim returnValue As Integer
Dim range1 As Range
returnValue = range1.CopyFromRecordset(Data, MaxRows, MaxColumns)

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.

If the Recordset object contains fields with OLE objects in them, this method fails.

Copying begins at the current row of the Recordset object. After copying is completed, the EOF property of the Recordset object is True.


Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Development Platforms

Windows XP Home Edition, Windows XP Professional, Windows Server 2003, and Windows 2000

Target Platforms

Community Additions

Show:
© 2015 Microsoft