Activex OLE Delphi

//murat turan
uses comobj;
{$R *.DFM}
procedure TForm1.EXCEL_ORNEK_KOD;
var
EXCEL, WORKBOOK, SHEET:VARIANT;
begin
EXCEL := CREATEOLEOBJECT('EXCEL.APPLICATION');{EXCEL 'İ AÇMA}
EXCEL.VISIBLE :=TRUE;{EXCEL 'İ AKTİF YAPMA}
WORKBOOK :=EXCEL.WORKBOOKS.ADD;{KİTAP EKLEME}
SHEET:=WORKBOOK.WORKSHEETS[1];{SAYFA NUMARASI}
SHEET.CELLS[1,1]:= 'DENEME METİN'; {SATIR,SÜTUN}
SHEET.CELLS[1,1].Font.Color := $00E88017;
SHEET.CELLS[1,1].Font.Bold := True;
SHEET.CELLS[1,1].Font.italic := True;
SHEET.CELLS[1,1].Font.Underline := true;
SHEET.CELLS[1,1].Font.Size := 20;
SHEET.CELLS[1,1].Characters(3, 1).Font.Bold := True; {HÜCRE İÇİNDE BİR ARALIKDAKİ METNE HİTAP ETME}
SHEET.RANGE['A1:A10'].Borders.Color := $00E88017; {aralıktaki bütün hücrelerin dört kenarını renklendirir}
SHEET.CELLS[1,10].Borders.LineStyle := xlContinuous; {BİR HÜCREYE HİTAP ETME}
SHEET.RANGE['A1:A10'].Borders.LineStyle := xlContinuous;{BELİRLİ BİR ARALIĞA HİTAP ETME}
{XlLineStyle -> xlContinuous, xlDash, xlDashDot, xlDashDotDot, xlDot, xlDouble, xlSlantDashDot, or xlLineStyleNone.}
{BİR HÜCRENİN HERHANGİ BİR KENARLIĞININ RENGİNİ BELİRLEME}
{Tipler: xlInsideHorizontal, xlInsideVertical, xlDiagonalDown, xlDiagonalUp, xlEdgeBottom, xlEdgeLeft, xlEdgeRight, or xlEdgeTop.}
SHEET.RANGE['B1:F2'].Borders(xlEdgeTop).Color := 00E88017;
{istenilen yern sütun rengini belirleme}
SHEET.RANGE['B1:F2'].Interior.Color := 00E88017;
SHEET.RANGE['B1:F2'].Interior.ColorIndex := 1; {ColorIndex index kulalnınca her rengin bir kodu var kökde bunları yazmım}
SHEET.Range['A1:H8'].Formula := '=rand()';
SHEET.Range('A1').ClearContents; {İSTENİLEN HÜCRELERİ TEMİZLEME}
{SATIR SÜTUN LARA HİTAP ETME}
SHEET.Range['A1'].Columns.ColumnWidth := 20;{sadece belirtilen hücreyi}
SHEET.Range['A1'].Rows.RowHeight := 20;
SHEET.Columns.ColumnWidth := 25; {tüm sayfada etkili}
SHEET.Rows.RowHeight := 25;
SHEET.Columns(1).Font.Bold := True;
SHEET.Rows(1).Font.Bold := True;
SHEET.Columns(1).Delete;
SHEET.Rows(3).Delete;
end;