|

楼主 |
发表于 2010-7-26 14:51:15
|
显示全部楼层
现在还有一个问题,就是我打开了本地的,Xls文件,我想把该文件中对应表格的数据保存到数据库中,又该如何实现呢?代码如下:
var
//ExcelID:Variant;
iFileName:string;
ExcelID,ExcelID1:Object;
FApp,FDocs : System.DispatchHelper;
iNr :String;
begin
Inherited;
Self.OpenDialogPerson.Execute;
iFileName := Self.OpenDialogPerson.FileName;
ExcelID :=Business.System.ComObj.CreateOleObject( 'Excel.Application' );
FApp :=System.DispatchHelper.Create(ExcelID);
FApp.PropertyPut('Visible',[True]);
ExcelID1 := FApp.PropertyGet('Workbooks', []);
FDocs := System.DispatchHelper.Create(ExcelID1);
FDocs.InvokeMethod('Open', [iFileName]);
iNr :=对应表格的内容;
最后这句话“iNr :=对应表格的内容;”该如何实现? |
|