uses ComObj;
代码很简单就不用备注了吧
var
ExcelApp:Variant;
c1,c2,r1,r2:Variant;
begin
try
ExcelApp := CreateOleObject('Excel.Application');
ExcelApp.WorkBooks.Open('C:UsersAdministratorDesktopceshi.xlsx');
c1 := ExcelApp.ActiveWorkBook.Sheets[1];
c2 := ExcelApp.ActiveWorkBook.Sheets[1];
r1 := c1.range[c2.cells[1, 1], c1.cells[1, 2]];
r1.select;
r1.copy;
r2 := c2.range[c2.cells[10, 10], c2.cells[10, 11]];
r2.select;
c2.paste;
finally
ExcelApp.ActiveWorkBook.Saved := true;
ExcelApp.WorkBooks.Close;
ExcelApp.Quit;
end;
end;