参看以下代码应该可以sheet,XLApp,workbook : variant; iRow,MaxRow:integer;begin screen.Cursor:=crHourGlass; try //创建对象 XLApp:=createOleObject('Excel.Application'); XLApp.displayAlerts:=false; XLApp.ScreenUpdating:=false; XLApp.WorkBooks.Add(EXLfile); workbook := XLApp.workbooks[1]; sheet:=workbook.worksheets[1]; //sheet:=XLApp.WorkBooks[1].worksheets[1]; //取得最大行数 maxRow XLApp.ActiveCell.SpecialCells(xlLastCell).Select; maxRow:=XLApp.ActiveCell.Row; //最大行数 //写数据到Access库 ADOTable1.open; for iRow:=2 to MaxRow do if sheet.cells[iRow,1]<>'' then //关键字不为空 begin ADOTable1.Append ; ADOTable1.fieldByName('ID').asInteger:= strToInt(sheet.cells[iRow,1]); ADOTable1.fieldByName('code').asString:=sheet.cells[iRow,2]; //编码 ADOTable1.fieldByName('name').asString:=sheet.cells[iRow,3]; //名称 ADOTable1.post; end; finally if not VarIsEmpty(XLApp) then begin //释放对象 XLApp.displayAlerts:=false; XLApp.ScreenUpdating:=true; XLApp.quit; end;