var
iexcel:variant;
begin
try
iexcel:=createoleobject('excel.application');
except
begin
//
// showmessage('d');
application.MessageBox('数据传输出错,请确认Microsoft Excel是否安装!','操作报告',Mb_Ok);
exit;
end;
end;
try
iexcel.workbooks.open(file_edit.text);
iexcel.sheetS[1].activate;
for i:=2 to iexcel.cells.count do
begin
table.append;
for j:=1 to 15 do
begin
Table.FieldValues[iexcel.cells[1,j].value] :=iexcel.cells[i,j].value;
//这里的几句话就看你自己了..不难的.
end;
table.post;
end;
finally
iexcel.quit;
end;
end;
end;
end;