Cómo usar DELPHI para controlar si una determinada celda en EXCEL muestra un determinado borde
procedimiento TForm_ejjgs.BitBtn8Click(Remitente: TObject);
var
excel, libro de trabajo: variante
xlsfilename: cadena <; /p>
i, j: entero;
comenzar a intentar
excel: = createoleobject('excel.application'); createoleobject('excel.sheet'); excepto
showmessage('Microsoft excel no está instalado en su máquina');
end
try p> p>
excel:=createoleobject('excel.application');
excel.workbooks.open('c:\gcsgl\demo.xls');
xlsfilename :='demo.xls';
excel.worksheets.value:='número de serie'
excel.cells.value:='Nombre'; >
excel.cells.value:='Oficina registrada';
excel.cells.value:='ID No..weight:=2
excel.activesheet; .range ['a2:h' InttoStr(j 2)].borders[3].weight:=2;
excel.activesheet.range['a2:h' InttoStr(j 2)]. HorizontalAlignment: =3;
excel.activesheet.columns[2].HorizontalAlignment:=3;
excel.activesheet.columns[5].HorizontalAlignment:=3;
excel.activesheet.columns[7].Alineación horizontal:=3;
excel.activesheet.columns[2].verticalAlignment:=2;
excel.activesheet . columns[1].ShrinkToFit:=true;
excel.activesheet.columns[8].ReadingOrder:=xlContext;
//Establecer página márgenes Distancia
excel.activesheet.pagesetup.topMargin: =2/0.035
excel.activesheet.pagesetup.headerMargin: =1.8/0.035
excel; activesheet.pagesetup.leftMargin:=1,5/ 0,035;
excel.activesheet.pagesetup.right.
Margin:=1/0.035;
excel.activesheet.pagesetup.bottomMargin:=2/0.035;
// Establecer propiedades de texto.
excel.activesheet.Columns['d:d'].NumberFormatLocal:='0';
excel.activesheet.Columns['e:e'].NumberFormatLocal:= '0';
excel.activesheet.pagesetup.bottomMargin:=2/0.035
// Establecer propiedades de texto. excel.activesheet.Columns['e:e'].NumberFormatLocal:='0';
//excel.ActiveSheet.PageSetup.PrintArea:='';
excel. ActiveSheet.PageSetup.PrintArea:='';