Pasar datos a una hoja Excel

PEPE CASTELLON
28 de Febrero del 2004
Tengo una Base Access de clientes, cuando hago una consulta para buscar un cliente y despues de que me aparezca, como podria mandar sus datos a una hoja Excel para hacer una factura con esos datos???
o acaso hay alguna forma eb VB mas comoda que una Excel!!!
Gracias por adelantado.

cortan
28 de Febrero del 2004
Proba con esto ami me funciona

Private Sub cmdLoad_Click()
Dim excel_app As Object
Dim excel_sheet As Object
Dim row As Integer
Dim conn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim statement As String

Screen.MousePointer = vbHourglass
DoEvents

' Create the Excel application.
Set excel_app = CreateObject("Excel.Application")

' Uncomment this line to make Excel visible.
' excel_app.Visible = True

' Open the Excel spreadsheet.
excel_app.Workbooks.Open FileName:=txtExcelFile.Text

' Check for later versions.
If Val(excel_app.Application.Version) >= 8 Then
Set excel_sheet = excel_app.ActiveSheet
Else
Set excel_sheet = excel_app
End If

' Open the Access database.
Set conn = New ADODB.Connection
conn.ConnectionString = _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & txtAccessFile.Text & ";" & _
"Persist Security Info=False"
conn.Open

' Select the data.
statement = "SELECT * FROM TestValues ORDER BY DataPoint"

' Get the records.
Set rs = conn.Execute(statement, , adCmdText)

' Get data from the database and insert
' it into the spreadsheet.
row = 1
Do While Not rs.EOF
excel_sheet.Cells(row, 1) = rs!DataPoint

row = row + 1
rs.MoveNext
Loop

' Close the database.
rs.Close
Set rs = Nothing
conn.Close
Set conn = Nothing

' Comment the rest of the lines to keep
' Excel running so you can see it.

' Close the workbook saving changes.
excel_app.ActiveWorkbook.Close True

' Close Excel.
excel_app.Quit
Set excel_sheet = Nothing
Set excel_app = Nothing

Screen.MousePointer = vbDefault
MsgBox "Copied " & Format$(row - 1) & " values."
End Sub