rb 发表于 2002-9-17 12:56:00

Excel sheet1被打开,但无"Sheet1"''Line'等字符.程序提示:找不到成员。请问

Excel sheet1被打开,但无"Sheet1"''Line'等字符.程序提示:找不到成员。请问?下面是 Delphi程序代码

    ExcelAppStr:='Excel.Application';
    ExcelInstalled := True;

    try
      ExcelObj:=GetActiveOleobject(ExcelAppStr);
    except
      on EOleSysError do
          ExcelAlreadyRunning:=false;
    end;

    if not ExcelAlreadyRunning then
      try
      ExcelObj:=CreateOleObject(ExcelAppStr);
      except
      begin
          MessageDlg('没有安装Excel。', mtInformation, , 0);
          ExcelInstalled := false;
      end;
      end;

    if not ExcelInstalled then Exit ;    // Terminate the Application

   ExcelObj.Visible := True;
   ExcelObj.Workbooks.add;
   ExcelWorkSheet:=ExcelObj.ActiveWorkBook.Sheets('"Sheet1"');
   ExcelWorkSheet.Cells.value:='Line';
   ExcelWorkSheet.Cells.value:='Start';
   ExcelWorkSheet.Cells.value:='End';
   

Excel sheet1被打开,但无"Sheet1"''Line'等字符
程序提示:找不到成员。请问?
页: [1]
查看完整版本: Excel sheet1被打开,但无"Sheet1"''Line'等字符.程序提示:找不到成员