PHP fails to open an Excel workbook through COM
问题 This code works fine until it gets to the open workbook line and then it fails. <?PHP $file = "C:\\xampp\\htdocs\\php\\test.xls"; openWorkbook($file); function openWorkbook($file) { $excel = new COM("Excel.Application") or die ("ERROR: Unable to instantaniate COM!\r\n"); echo "Application name: {$excel->Application->value}\r\n"; echo "Loaded version: {$excel->Application->version}\r\n"; // FAILS ON THIS LINE! $Workbook = $excel->Workbooks->Open($file) or die("ERROR: Unable to open " . $file .