code: private function writeSheet(XMLWriter $objWriter, $pSheetname, $pSheetId = 1, $pRelId = 1, $sheetState = 'visible')
      {
          if ($pSheetname != '') {
              // Write sheet
              $objWriter->startElement('sheet');
              $objWriter->writeAttribute('name', $pSheetname);
              $objWriter->writeAttribute('sheetId', $pSheetId);
              if ($sheetState != 'visible' && $sheetState != '') {
                  $objWriter->writeAttribute('state', $sheetState);
              }
              $objWriter->writeAttribute('r:id', 'rId' . $pRelId);
              $objWriter->endElement();
          } else {
              throw new WriterException('Invalid parameters passed.');
          }
      }
docs: Write sheet.
  
  @param XMLWriter $objWriter XML Writer
  @param string $pSheetname Sheet name
  @param int $pSheetId Sheet id
  @param int $pRelId Relationship ID
  @param string $sheetState Sheet state (visible, hidden, veryHidden)
  
  @throws WriterException