zhaojs
2023-07-31 0de015249a3abe05031eb4f5d988e8eb7ef83c87
1
2
3
4
5
6
7
8
9
10
11
12
<?php
 
require __DIR__ . '/../Header.php';
$spreadsheet = require __DIR__ . '/../templates/sampleSpreadsheet.php';
 
// Set password against the spreadsheet file
$spreadsheet->getSecurity()->setLockWindows(true);
$spreadsheet->getSecurity()->setLockStructure(true);
$spreadsheet->getSecurity()->setWorkbookPassword('secret');
 
// Save
$helper->write($spreadsheet, __FILE__);