Hide or Unhide a Worksheet in Php

Aspose.Cells - Hide or Unhide a Worksheet

Hiding a Worksheet

To hide worksheet using Aspose.Cells Java for PHP, call hideunhideworksheet module.

PHP Code

 //Instantiating a Workbook object by excel file path

$workbook = new Workbook($dataDir . "book1.xls");

//Accessing the first worksheet in the Excel file

$worksheets = $workbook->getWorksheets();

$worksheet = $worksheets->get(0);

//Hiding the first worksheet of the Excel file

$worksheet->setVisible(false);

//Saving the modified Excel file in default (that is Excel 2003) format

$workbook->save($dataDir . "output.xls");

Download Running Code

Download Hide or Unhide a Worksheet (Aspose.Cells) from any of the below mentioned social coding sites: