首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

OLE 访问Excel出错?请问了

2012-04-09 
OLE 访问Excel出错??请教了varExcelApp,Sheet: VariantbeginExcelApp:CreateOleObject(Excel.Applicati

OLE 访问Excel出错??请教了
var
  ExcelApp,Sheet: Variant;
begin
 ExcelApp:=CreateOleObject('Excel.Application');
 ExcelApp.Workbooks.open(fEdit.Text);
 ExcelApp.Worksheets[1].Activate;
 Sheet:=ExcelApp.Worksheets[1];

 Form1.Caption:= ExcelApp.Worksheets[1].Cells[0,0];

 ExcelApp.ActiveWorkBook.Saved := True;
 ExcelApp.WorkBooks.Close;
 ExcelApp.Quit;

以上执行,提示错误 OLE error 800A03EC

哪里错了呢?

[解决办法]

Delphi(Pascal) code
 Form1.Caption:= ExcelApp.Worksheets[1].Cells[1,1]; 

热点排行