高手進來。PHP操作Excel錯誤!!!
taiks 2009-10-16 11:09:01 代碼
<?php
$workbook = "E:\\php\\htdocs\\Excel\\test.xls";
$sheet = "sheet1";
$ex = new com("Excel.sheet") or die ("鏈接錯誤");
$book = $ex->application->workbooks->open($workbook) or die ("鏈接錯誤");
$sheets = $book->worksheets($sheet);
$sheets->activate;
$cell = $sheets->cells(5,5);
$cell->activate;
$cell->value = 999;
$ex->application->activeworkbook->close("false");
unset ($ex);
?>
報錯
Fatal error: Uncaught exception 'com_exception' with message 'Failed to create COM object `Excel.sheet': 存放裝置空間不足,無法完成此操作。 ' in E:\php\htdocs\Excel\Index.php:5 Stack trace: #0 E:\php\htdocs\Excel\Index.php(5): com->com('Excel.sheet') #1 {main} thrown in E:\php\htdocs\Excel\Index.php on line 5
謝謝。。。