R
Robert Crandal
I have seen a few code examples that use ADO to open a
"connection" to an Excel 2007 file. After a connection is established,
I typically see code such as this:
'=======================================
' Check to make sure we received data.
If Not rsData.EOF Then
Sheet1.Range("A1").CopyFromRecordset rsData
Else
MsgBox "No records returned.", vbCritical
End If
'======================================
The above code pastes data from the "rsData" recordset object
into Sheet1 starting at range A1. My question is, what if I don't
want to paste my recordset onto the spreedsheet?? Can't I
simply assign specific data values from the recordset to a Visuabl Basic
variable??
Thank you!
"connection" to an Excel 2007 file. After a connection is established,
I typically see code such as this:
'=======================================
' Check to make sure we received data.
If Not rsData.EOF Then
Sheet1.Range("A1").CopyFromRecordset rsData
Else
MsgBox "No records returned.", vbCritical
End If
'======================================
The above code pastes data from the "rsData" recordset object
into Sheet1 starting at range A1. My question is, what if I don't
want to paste my recordset onto the spreedsheet?? Can't I
simply assign specific data values from the recordset to a Visuabl Basic
variable??
Thank you!