php_excel icon indicating copy to clipboard operation
php_excel copied to clipboard

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

Open sgiacinto opened this issue 3 years ago • 1 comments

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?

sgiacinto avatar Aug 23 '22 19:08 sgiacinto

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.

johmue avatar Aug 24 '22 19:08 johmue