First create an Excel object, use Comobj: Var Excelapp: Variant; Excel.Application '); Release Variables at the end of the program EXCELAPPP: = unassigned; 1 Display the current window: Excelapp.visible: = true; 2 Change Excel Title Bar: Excelapp.caption: = 'Application MICROFT Excel'; 3 Add New Workbook: Excelapp.workBooks.Add; 4 Open Exemplary Workbook: ExceLapp.Workbooks.Open ('C: Exceldemo.xls' 5 Setting the second worksheet as an active worksheet: excelapp.worksheads [2] .actiVate; or excelapp.workssheets ['sheet2'] .actiVate; add a worksheet ExceLapp.worksheets.add; worksheet heavy name excelapp. Worksheets [1] .Name: = 'Worksheet 1'; or Excelapp.worksheets ['Sheet1']. Name: = 'Worksheet 1'; Works Number ExceLapp.worksheets.count 6 to cell gauge: Excelapp.cells [1, 4] .Value: = 'The first row of fourth column'; 7 Set the width of the specified column (unit: characters), with the first list as an example: excelapp.activeesheet.columns [1] .columnswidth: = 5; 8 Set the height of the specified line (unit: lbs) (1 pound = 0.035 cm), take the second behavior: Excelapp.activesheet.Rows [2] .rtowheight: = 1 / 0.035; // 1 cm 9 Pediance 8 before plugging: Excelapp.worksheads [1] .Rows.pagebreak: = 1; 10 Delete Paging Pedestrians before column 8: Excelapp.activeesheet.columns [4] .pagebreak: = 0; 11 Specify the edge frame Width: Excelapp.activesheet.Range ['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 formula: Excelapp.activesheet.cells [1, 4] .clearContents; 13 Set the first line font attribute: Excelapp.activeesheet.Rows [1] .font.name: = '书'; Excelapp.activeesheet.Rows [1] .font.color: = CLBLUE; Excelapp.Activeesheet.Rows [1] .font.book: = true; Excelapp.activesheet.Rows [1] .font.underline: = true; 14 Make page settings: a. Header: Excelapp.activeesheet.pagesetup.centerheader: = 'report demonstration'; b. Foot: