我现在想打开一个excel,然后取出excel第一行第一列数据。看不到,也不出错。为什么啊?
以下是代码,请大家检查!
var
 i,j:integer;
begin
 opendialog1.InitialDir:=ExtractFileDir(paramstr(0));//文件的打存放初始路径
 opendialog1.Execute;
 showmessage('打开完毕');
Try
 ExcelApplication1.Connect;//EXCEL应用程序
 showmessage('连接完毕');
Except
 MessageDlg('Excel may not be installed',mtError, [mbOk], 0);
 Abort;
End;
 ExcelApplication1.Visible[0]:=True;
 ExcelApplication1.Caption:='Excel Application';
try
 excelapplication1.Workbooks.Open(opendialog1.FileName,
 null,null,null,null,null,null,null,null,null,null,null,null,0);//打开指定的EXCEL 文件
 showmessage('打开指定的完毕');
except
begin
 ExcelApplication1.Disconnect;//出现异常情况时关闭
 ExcelApplication1.Quit;
 showmessage('请选择EXCEL电子表格!');
 exit;
end;
 showmessage(ExcelWorksheet1.Cells.Item[1,1]);最后一个showmessage没有显示。请大家快进来看。我在线。