Vendor/phpspreadsheet/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xls/Worksheet.php
private function writePassword()
    {
        // Exit unless sheet protection and password have been specified
        if (!$this->phpSheet->getProtection()->getSheet() || !$this->phpSheet->getProtection()->getPassword()) {
            return;
        }

        $record = 0x0013; // Record identifier
        $length = 0x0002; // Bytes to follow

        $wPassword = hexdec($this->phpSheet->getProtection()->getPassword()); // Encoded password

        $header = pack('vv', $record, $length);
        $data = pack('v', $wPassword);

        $this->append($header . $data);
    }
private function writePassword()
    {
        // Exit unless sheet protection and password have been specified
        if (!$this->phpSheet->getProtection()->getSheet() || !$this->phpSheet->getProtection()->getPassword()) {
            return;
        }

        $record = 0x0013; // Record identifier
        $length = 0x0002; // Bytes to follow

        $wPassword = hexdec($this->phpSheet->getProtection()->getPassword()); // Encoded password

        $header = pack('vv', $record, $length);
        $data = pack('v', $wPassword);

        $this->append($header . $data);
    }
Write the worksheet PASSWORD record.