Ver Mensaje Individual
  #18  
Antiguo 07-07-2017
Avatar de roman
roman roman is offline
Moderador
 
Registrado: may 2003
Ubicación: Ciudad de México
Posts: 20.269
Reputación: 10
roman Es un diamante en brutoroman Es un diamante en brutoroman Es un diamante en bruto
Cita:
Empezado por TiammatMX Ver Mensaje
Y al final quedó así:

Código Delphi [-]
    oExcel := CreateObject( "Excel.Application" )
* FEOL No eliminar ésta línea, si'l vous plait...
*      oExcel:visible := .T.
      oExcel:SheetsInNewWorkbook := 1
    oHoja := oExcel:Workbooks:Add
      oSheet := oHoja:ActiveSheet
      oSheet:Cells( 1, 1 ):value := 'CODIGO'
      oSheet:Cells( 1, 2 ):value := 'PRECIO'
      oSheet:Cells( 1, 3 ):value := 'MONEDA'

      cStmt    := "SELECT ACODPRO, APREACT AS PRECIO, ATIPMON AS MONEDA FROM FALISPR WHERE ANUMLIS=?"
      oCurArti := ADODataSet():create( cStmt, gConn )
      oCurArti:Execute( oLis:value )

      DO WHILE !oCurArti:EOF()

        oSheet:Cells( iRen, 1 ):value := oCurArti:ACODPRO
        oSheet:Cells( iRen, 2 ):value := oCurArti:PRECIO
        oSheet:Cells( iRen, 3 ):value := oCurArti:MONEDA

         oCurArti:skip()
         iRen++
      ENDDO

      oHoja:SaveAs( cNomArc )
      oExcel:ActiveWorkbook:Close()
      oExcel:Quit()

OK, no es Delphi, pero creo que quedó entendible. Hace lo que debe, sin problemas o errores..., gracias a todos por su colaboración.
Guau! O sea que con Clipper tienes acceso a objetos COM? Y, ¿qué tal los tiempos? ¿Cuanto tarda el volcado?

LineComment Saludos
Responder Con Cita