I am trying to save a worksheet using the code below
excel = new COM("Excel.application");
$excel->Workbooks->Add;
$excel->Workbooks[1]->WorkSheets->Add;
$excel->ActiveWorkbook->SaveAs('C:\MyDir\test.xls');
$excel->Workbooks->Close;
$excel->workbooks->Quit;
....but whenever I try to do this, I recieve the error:
Fatal error: Uncaught exception 'com_exception' with message 'Source: Microsoft Office Excel Description: Unable to get the SaveAs property of the Workbook class' in C:\inetpub\wwwroot\index.php:8 Stack trace: #0 C:\inetpub\wwwroot\index.php(8): variant->SaveAs('C:\MyDir\test.x...') #1 {main} thrown in C:\inetpub\wwwroot\index.php on line 8.
This method only takes one compulsary parameter.
I am running Vista and using IIS7.
Hope someone can help