var MyExcelApp : Variant ;
MySheet : Variant ;
try
MyExcelApp := CreateOleObject( 'Excel.Application' );
except
messagebox(0,'Excel没有正确安装!','错误',mb_iconerror);
exit;
end;
MyExcelApp.Visible := false; // 让对象Excel不可视
try
MyExcelApp.WorkBooks.Open( edit1.Text ) ;
except
showmessage('文件不存在!') ;
exit
end ;
MySheet:=MyExcelApp.ActiveSheet;
temp := Mysheet.cells[i, j].value;