我的程序读EXCEL表都是可以读出来的..
有一小部分程序......
$dataobj = new Spreadsheet_Excel_Reader();
$dataobj->setOutputEncoding('Shift_JIS');
$dataobj->read($filepath);
error_reporting(E_ALL ^ E_NOTICE);
echo "总行数:".($dataobj->sheets[0]['numRows']-1)."<br>";
echo "总列数:".$dataobj->sheets[0]['numCols']."<br><br>";
if ($dataobj->sheets[0]['numCols']==6){
for ($i = 2; $i <= $dataobj->sheets[0]['numRows']; $i++) {
$pic_name=$dataobj->sheets[0]['cells'][$i][1];
$pic_code=$dataobj->sheets[0]['cells'][$i][2];
$cate_id=$dataobj->sheets[0]['cells'][$i][3];
         $kind=$dataobj->sheets[0]['cells'][$i][4];
if ($kind=="0"){
$kind="picture";
}elseif ($kind=="1"){
$kind="cartoon";
}else{
$kind="flash";
}
$company=$dataobj->sheets[0]['cells'][$i][5];

解决方案 »

  1.   

    我的程序到这一步的时候有错:
    $excel = new COM("Excel.sheet") or Die ("Did not instantiate Excel");// 建立EXCEL的COM对象错误信息:
    Fatal error: Uncaught exception 'com_exception' with message 'Failed to create COM object `Excel.sheet': 拒绝访问。 ' in E:\iis\libraire\excel\excel.php:40 Stack trace: #0 E:\iis\libraire\excel\excel.php(40): com->com('Excel.sheet') #1 E:\iis\libraire\excel\testclass.php(28): Excel->excel() #2 {main} thrown in E:\iis\libraire\excel\excel.php on line 40
    我用的IIS(6.0)+windows 2003 server
    我的QQ:531515035
    email :jiehan126.com
    谢谢指点
      

  2.   

    我的程序到这一步的时候有错:
    $excel = new COM("Excel.sheet") or Die ("Did not instantiate Excel");// 建立EXCEL的COM对象错误信息:
    Fatal error: Uncaught exception 'com_exception' with message 'Failed to create COM object `Excel.sheet': 拒绝访问。 ' in E:\iis\libraire\excel\excel.php:40 Stack trace: #0 E:\iis\libraire\excel\excel.php(40): com->com('Excel.sheet') #1 E:\iis\libraire\excel\testclass.php(28): Excel->excel() #2 {main} thrown in E:\iis\libraire\excel\excel.php on line 40
    我用的IIS(6.0)+windows 2003 server
    我的QQ:531515035
    email :[email protected]
    谢谢指点