procedure TForm1.Memo1KeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
var
 i,j,h,l,h2,l2: Integer;
 ab: string;
 ac: string;
 ExcelApp,WorkBook,WorkSheet: Variant;
 ExcelApp2,WorkBook2,WorkSheet2: Variant;
begin
 if int(key)<>13 then
 begin
  //if int(key)= 32 then
 // begin
  //  Label5.Caption :=Label5.Caption;
  //  ShowMessage(Label5.Caption);
 // end
 // else
 // begin
    Label5.Caption :=Memo1.Lines.Strings[Memo1.Lines.Count-1];
  //end;
 end
 else
 begin
  ab:=Label5.Caption;
  //Label5.Caption :='';
  ExcelApp := CreateOleObject('Excel.Application');
  ExcelApp.Visible := false;
  WorkBook := ExcelApp.WorkBooks.Open(Edit1.Text);
  ExcelApp.WorkSheets[1].Activate;
  WorkSheet := WorkBook.WorkSheets.Item[1];
  l :=ExcelApp.worksheets[1].Usedrange.columns.count;
  h :=ExcelApp.worksheets[1].Usedrange.rows.count;
  for i:=1 to h-1 do
  begin
    for j:= 1 to l-1 do
    begin
      if Memo1.Lines.Strings[Memo1.Lines.Count-1] = ExcelApp.Cells[i,j].Value  then
      begin
        Memo2.Lines.Add('OK');        //////////////////////////// 有问题 ////////////////////////////////
        ExcelApp2 := CreateOleObject( 'Excel.Application' );
        ExcelApp2.Visible := false;
        WorkBook2 := ExcelApp.WorkBooks.Open(Edit2.Text);
        ShowMessage('145553');
        ExcelApp2.WorkSheets[1].Activate; //有问题
        WorkSheet2 := WorkBook2.WorkSheets.Item[1];
        h2 :=ExcelApp2.worksheets[1].Usedrange.rows.count;
        ShowMessage(inttostr(h2));
        ExcelApp2.ActiveSheet.row.copy(ExcelApp.ActiveSheet.row[i].value);
        // myRange1:=sheet.Range[sheet.cells[39,1],sheet.cells[79,16]];
        // myRange2:=sheet.Range[sheet.cells[80,1],sheet.cells[120,16]];
        //myRange1.Copy(myRange2) ;
        continue;
      end
      else
      begin
        Memo2.Lines.Add('SN没有扫描到!');
      end;        continue;
     end;
    end;
  end;
 end;代码如上,提示的是这句;ExcelApp2.WorkSheets[1].Activate; 有问题。问题提示为:raised exception class EoLeException with message 'OLE error 800A03EC'.请各位大虾指教指教。