//首先一步
$excel = new COM("Excel.sheet") or Die ("Did not instantiate Excel");// 建立EXCEL的COM对象//打开一个工作簿
$pathin = "工作簿目录";
$workbook = "工作簿名称";
$wkb = $excel->application->Workbooks->Open($pathin.$workbook) or Die ("Did not open $pathin $workbook"); //建新工作簿
$wkb = $excel->application->Workbooks->Add or Die("Unable to add a new work book");//打开工作表
$sheet_name = "sheet1"
$sheet = $wkb->Worksheets($sheet_name) or Die("Unable to active $sheet_name");//读一个单元格
$readcell = $sheet->cells($row,$column); //行和列直接用十进制数表示
$readcell->activate;
$result = $selcell->value;  //读出单元格值

解决方案 »

  1.   

    我用了啊,但是硬盘不断的在读啊根本就不行呀
    我的代码如下,就这么个简单的东西都通过不了,老是读盘
    <?
    //  $excel="ff";
      $excel   =   new   COM("Excel.sheet")   or   Die   ("Did   not   instantiate   Excel");//   建立EXCEL的COM对象   
      echo $excel;
      /*
      $pathin   =   "工作簿目录";   
      $workbook   =   "工作簿名称";   
      $wkb   =   $excel->application->Workbooks->Open($pathin.$workbook)   or   Die   ("Did   not   open   $pathin   $workbook");     
      $wkb   =   $excel->application->Workbooks->Add   or   Die("Unable   to   add   a   new   work   book");   
      $sheet_name   =   "sheet1"   
      $sheet   =   $wkb->Worksheets($sheet_name)   or   Die("Unable   to   active   $sheet_name");   
      $readcell   =   $sheet->cells($row,$column);   //行和列直接用十进制数表示   
      $readcell->activate;   
      $result   =   $selcell->value;
      */
    ?>
      

  2.   

    谁能给个例子我呀,最好是连EXCEL也一起发给我呀