code: private function writeDefinedNameForPrintArea(XMLWriter $objWriter, Worksheet $pSheet, $pSheetId = 0)
      {
          // definedName for PrintArea
          if ($pSheet->getPageSetup()->isPrintAreaSet()) {
              $objWriter->startElement('definedName');
              $objWriter->writeAttribute('name', '_xlnm.Print_Area');
              $objWriter->writeAttribute('localSheetId', $pSheetId);
  
              // Print area
              $printArea = Coordinate::splitRange($pSheet->getPageSetup()->getPrintArea());
  
              $chunks = [];
              foreach ($printArea as $printAreaRect) {
                  $printAreaRect[0] = Coordinate::absoluteReference($printAreaRect[0]);
                  $printAreaRect[1] = Coordinate::absoluteReference($printAreaRect[1]);
                  $chunks[] = '\'' . str_replace("'", "''", $pSheet->getTitle()) . '\'!' . implode(':', $printAreaRect);
              }
  
              $objWriter->writeRawData(implode(',', $chunks));
  
              $objWriter->endElement();
          }
      }
docs: Write Defined Name for PrintTitles.
  
  @param XMLWriter $objWriter XML Writer
  @param Worksheet $pSheet
  @param int $pSheetId