Hi Guys,
I am trying to set the Worksheet Name property in a PHP script, using the Aspose.Cells.Interop.dll COM component.
When I execute the below php script, line 7:
"$ptr->Set($worksheet, “Name”,array(“MySheetName”));"
fails with the following error (output into the PHP error log):
PHP Fatal error: Uncaught exception ‘com_exception’ with message ‘Error [0x80070057] The parameter is incorrect.
’ in C:\inetpub\asposetest\www\test.php:7
Stack trace:
#0 C:\inetpub\asposetest\www\test.php(7): com->Set(Object(variant), ‘Name’, Array)
#1 {main}
thrown in C:\inetpub\asposetest\www\test.php on line 7
I am using PHP 5.4.
If I comment out line 7, the script completes successfully and I end up with a valid xlsx file.
Thanks in advance.
PHP File:
<?php
$ptr= new COM("Aspose.Cells.Interop.InteropHelper")or die('Unable to load helper');
$workbook = $ptr->New("Aspose.Cells.Workbook",array());
$worksheets = $ptr->Get($workbook,"Worksheets",array());
$worksheet = $ptr->Get($worksheets,"Item",array(0));
$ptr->Set($worksheet, "Name",array("MySheetName"));
$ptr->Call($workbook,"Save",array("c:\\PHPTest.xls"));
?>
Cheers,
Michael.