|
lOExcel :=Comobj.CreateOleObject('Excel.application');
lapp :=system.DispatchHelper.create(lOExcel);
lOWorkBook:=lApp.PropertyGet('WorkBooks',[]);
ldocs :=system.DispatchHelper.Create(lOWorkBook) ;
ldocs.InvokeMethod('open',['C:\test.xls']);
lORange:=lapp.PropertyGet('Range',['B2']);
lRange :=system.DispatchHelper.Create(lORange);
lRange.InvokeMethod('Select',[]);
lRange.PropertyGet('value',[lstr]);
Dialogs.ShowMessage(lstr);
(lORange as System.IDisposable).Dispose;
(lOWorkBook as System.IDisposable).Dispose;
(lOExcel as System.IDisposable).Dispose;
这样我们取不到B2这个单元格中的内容。请帮忙看一下 |
|