mateow380
Usuario (Colombia)

Porque hay mucha gente que aun usa el visual basic 6.0 aca les dejo un ejemplo de como enviar a un libro existente y a hojas especificas, practico para adaptarlo a cualquier proyecto que genere reportes con excel Private Sub reporte() On Error GoTo mal Dim objArchivoXls As Object Dim co1 As Integer Dim intUltimo As Long Const xlDown As Integer = -4121 If Len(Dir("c:creditosabonos.xls") > 0 Then Set objArchivoXls = GetObject("c:creditosabonos.xls" objArchivoXls.Worksheets(Combo1.Text).Activate With objArchivoXls.ActiveSheet .Parent.Windows("abonos.xls".Visible = True intUltimo = .Range("A1".End(xlDown).Row + 1 For co1 = intUltimo To intUltimo + 0 .Cells(co1, 1).Value = Format(CDate(Date), "mm/dd/yyyy" .Cells(co1, 2).Value = Time .Cells(co1, 3).Value = "Text2" .Cells(co1, 4).Value = "Text3" .Cells(co1, 5).Value = "Text4" .Cells(co1, 6).Value = "Text9" .Cells(co1, 7).Value = "Text6" .Cells(co1, 8).Value = "Text7" Next co1 End With objArchivoXls.Save objArchivoXls.Parent.Quit Set objArchivoXls = Nothing MsgBox "Proceso terminado" Else MsgBox "Archivo no existe" End If Exit Sub mal: MsgBox "Hoja de calculos no encontrada" objArchivoXls.Parent.Quit Set objArchivoXls = Nothing End Sub Private Sub exportar_Click() Call reporte End Sub Nota El combo que carga las hojas no fue llenado por codigo lo hice por la propiedad list