delphi_excel教程(delphi_excel教程)delphi_excel教程(delphi_excel教程) (1) using dynamic creation methods First, create Excel objects, Obj: Var ExcelApp: Variant; ExcelApp: = CreateOleObject (''); 1) displays the current window: : = True; 2) change the title bar of Excel: : = 'application calls Microsoft Excel'; 3) add a new workbook: ; 4) open the existing workbook: ('C:\Excel\'); 5) set up second worksheets as active worksheets: [2].Activate; or ['Sheet2'].Activate; 6) assign values to cells: [1,4].value: = 'first row, fourth column'; 7) set the width of the specified column (unit: number of characters), take the first column as an example: [1].ColumnsWidth: = 5; 8) set the height of the specified row (unit: pound) (1 pounds = centimeters), with second behavior examples: [2].RowHeight: = 1/; / / 1 cm 9) Insert page breaks in the eighth line before: [1].Rows[8].PageBreak: = 1; 10) remove the break in the eighth column before: [4].PageBreak: = 0; 11) specifies the width of the border line: ['B3:D4'].Borders[2].Weight: = 3; 1- left 2-, right 3- top, 4- bottom 5- oblique (\) 6- oblique (/) 12) clear the first row of fourth column cell formula: [1,4].ClearContents; 13) set the first line font property: [1].: = 'script'; [1].: = clBlue; [1].: = True; [1].: = True; 14) page setup: A. header: : = 'report demo'; B. footer: : = "page &P"; C. header to top margin 2cm: : = 2/; D. footer e