Ver Mensaje Individual
  #2 (permalink)  
Antiguo 02/04/2003, 14:52
Gennys
 
Fecha de Ingreso: marzo-2003
Ubicación: Santa Marta
Mensajes: 30
Antigüedad: 21 años, 2 meses
Puntos: 0
Hola Badjov. Te comento que lo de windows me, no tiene reversa vale #$&%, pero que se hace. Te envio este modulo para bajar informacion a excel, quizas tu tienes codigo que no debe ir.
Mira como funciona. 1 Yo hago un select sobre una tabla, luego si existe registro lo envio a este modulo, y hago todo esto para escribir en excel, yo lo utilizo en W95, 98 y 2000, yo no falla, mira que te sirve del codigo y aplicalo. en las referencias activas el OLE AUTOMATION y Excel 9 y dele---


Public Sub Excel_llamadas()
Dim xlsbook As New Excel.Workbook
Dim xlsheet As Excel.Worksheet
Dim g_iFila As Integer
Dim g_iColu As Integer

g_iFila = 1
g_iColu = 1
'xlsbook.Application.Caption = "Llamadas.xls"
Set xlbook = GetObject("c:\Windows\Temp\Llamadas\llamadas.xls")
xlbook.Application.Visible = False
xlbook.Windows(1).Visible = False
Set xlsheet = xlbook.Worksheets.Add

xlsheet.Cells.ColumnWidth = 20
xlsheet.Cells(g_iFila, g_iColu) = "Nombre Dependencia"
xlsheet.Cells(g_iFila, g_iColu + 1) = "Extensión"
xlsheet.Cells(g_iFila, g_iColu + 2) = "Fecha"
xlsheet.Cells(g_iFila, g_iColu + 3) = "Hora de Inicio"
xlsheet.Cells(g_iFila, g_iColu + 4) = "Hora Final"
xlsheet.Cells(g_iFila, g_iColu + 5) = "Telefono"
xlsheet.Cells(g_iFila, g_iColu + 6) = "Tiempo Llamada"
g_iFila = g_iFila + 1

rst.MoveFirst
While Not rst.EOF

clclar_tmpo2
If Val(g_ttal_mnto) >= 1 Then
xlsheet.Cells(g_iFila, g_iColu) = f_bscar_Nmbrextnsion(Trim(rst!trma7))
xlsheet.Cells(g_iFila, g_iColu + 1) = rst!trma7
xlsheet.Cells(g_iFila, g_iColu + 2) = CDate(rst!trma9 & "/" & rst!trma8 & "/" & "2001")
xlsheet.Cells(g_iFila, g_iColu + 3) = CDate(rst!trma10 & ":" & rst!trma11 & ":" & rst!trma12)
xlsheet.Cells(g_iFila, g_iColu + 4) = CDate(rst!trma15 & ":" & rst!trma16 & ":" & rst!trma17)
xlsheet.Cells(g_iFila, g_iColu + 5) = (Trim(rst!TRMA25))
xlsheet.Cells(g_iFila, g_iColu + 6) = g_hf_s
g_iFila = g_iFila + 1
Else
End If
0 rst.MoveNext
Wend
Cnsltar1.Cmd_Excel2.Enabled = False
Cnsltar1.Cmd_Excel.Enabled = False

If g_abrirEx Then
xlbook.Application.Visible = True
xlbook.Windows(1).Visible = True
Let g_Sexcel = "N"
l_iCntdor = l_iCntdor + 1
Else
MsgBox "Archivo Generado en Excel", vbInformation, "Crear Archivo Excel"
End If

End Sub