iliaal / php_excel

PHP Extension interface to the Excel writing/reading library
http://ilia.ws
534 stars 131 forks source link

ExcelBook->copySheet returns false #201

Closed archy-bold closed 3 years ago

archy-bold commented 7 years ago

I've recently upgraded my version of LibXL from 3.6.5 to 3.7.2 and php from 5.3 to 7. I managed to get this package installed on php7 (using the php7 branch) and I'm creating spreadsheets. However, I tried to call the function copySheet on an ExcelBook and where I'd expect it to return an ExcelSheet instance, it returns false.

Any ideas where this problem is occurring? Should I upgrade my version of LibXL or is this likely to be a bug on the php7 branch of php_excel?

Thanks!

johmue commented 7 years ago

Can not reproduce with latest php_excel and libxl 3.8.0 on Win/PHP 7.1

$book = new \ExcelBook(null , null, true);
$sheet = new \ExcelSheet($book, 'test');

$cs = $book->copySheet('test2', 0);

var_dump($cs);

$book->save(__FILE__ . '.xlsx');