iliaal / php_excel

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

Error when trying to hide a sheet with setHidden(true) #280

Closed sgiacinto closed 1 year ago

sgiacinto commented 1 year ago

Hello, built on PHP 8.1 getting: Uncaught Error: Call to a member function setHidden() on bool

when calling:

    $ex->getSheetByName("ttemplate")->setHidden(true);
    $ex->getSheetByName("LOOKUPS")->setHidden(true);

It worked with previous versions. Any idea?

johmue commented 1 year ago

Hi,

seems like one of those two calls already fails and returns false (instead of a sheet instance):

$ex->getSheetByName("ttemplate");
$ex->getSheetByName("LOOKUPS");

... in the subsequent step you are then calling setHidden() on false.