Hide or Unhide a Worksheet in PHP

Aspose.Cells - Hide or Unhide a Worksheet

Hiding a Worksheet

To hide a worksheet using Aspose.Cells for Java in PHP, call the 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 the default (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: