Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Servers
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

 
 
Herramientas Buscar en Tema Desplegado
  #29  
Antiguo 30-04-2004
candido candido is offline
Miembro
 
Registrado: may 2003
Posts: 11
Poder: 0
candido Va por buen camino
muchas gracias Roman, pero esta opcion no me vale porque no uso el objeto de delphi ExcelApplication, si no que lo creo mas o menos asi

---------------------------
Código Delphi [-]
     try
        XL := GetActiveOleObject('Excel.Application');
        //XL := GetActiveOleObject(DirBaseDatos + '\Plantillas\Etiquetas\etiquetas.xls');
     except
       XL := CreateOLEObject('Excel.Application');     // Ole object creation
       //XL := CreateOLEObject(DirBaseDatos + '\Plantillas\Etiquetas\etiquetas.xls');
     end;
     //XL.WorkBooks.add;
     if Ruta <> '' then
       XL.WorkBooks.open(Ruta)
     else
     XL.WorkBooks.add;     
     //XL.visible:=true;
     XL.visible:=False;

     j := 1;
     i := 0;
     while i < NoCampos do
     begin
        XArr[i+1]:=EXQuery.Fields[i].DisplayLabel;
        i := i+1;
        EXQuery.Next;
     end;
     XL.Range['A'+IntToStr(j),
     CHR(64+NoCampos)+IntToStr(j)].Value := XArr;

     XL.Range['A1',CHR(64+NoCampos)+IntToStr(j)].select;
     XL.Selection.Font.Name:='Times New Roman';
     XL.Selection.Font.Size:=10;
     XL.Selection.Font.color := clblue;
     XL.Selection.Font.bold := true;
     XL.Selection.Font.underline := true;


     j := 3;
     EXQuery.First;
     while not EXQuery.Eof do
     begin
       i:=1;
       while i<=NoCampos do
       begin
             XArr[i] := EXQuery.Fields[i-1].Value;
             i := i+1;
       end;
       XL.Range['A'+IntToStr(j),
         CHR(64+NoCampos)+IntToStr(j)].Value := XArr;
       EXQuery.Next;
       j := j + 1;
     end;
     XL.Range['A1',CHR(64+NoCampos)+IntToStr(j)].select;
     XL.selection.Columns.AutoFit;
     XL.Range['A1','A1'].select;
     XL.Quit;

----------------------

pero al final me pide que si quiero grabar o no, y no se como decirle que me lo grabe directamente

un saludo
__________________
Me da pena que se admire el valor en la batalla;
menos mal que con los rifles no se matan las palabras.

Última edición por roman fecha: 07-09-2006 a las 17:50:00. Razón: Añadir etiqueta [delphi] para mayor legibilidad
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro


La franja horaria es GMT +2. Ahora son las 13:51:45.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi