delphi 遍历EXCEL文档 ,查找指定区域的位置,并显示其值

来源:互联网 发布:js中获取元素的方法 编辑:程序博客网 时间:2024/05/21 17:29

遍历EXCEL文档 ,查找指定区域的位置,并显示其值

procedure TForm1.Button2Click(Sender: TObject);var   i:integer;begin     EApp := CreateOleObject( 'Excel.Application' );     EApp.Workbooks.Open('d:\book4.xls');     for i:=1 to EApp.worksheets.Count  do     begin       EApp.WorkSheets[i].Activate;       try showmessage(inttostr(EApp.ActiveSheet.Range['yq_sm_type'].row)) except end;       try showmessage(EApp.ActiveSheet.Range['yq_sm_type'].Value) except end;     end;end;
0 0
原创粉丝点击