单元格保护
Last updated
$config = [
'path' => './tests'
];
$excel = new \Vtiful\Kernel\Excel($config);
$fileObject = $excel->fileName('tutorial.xlsx');
$fileHandle = $fileObject->getHandle();
$editable = (new \Vtiful\Kernel\Format($fileHandle))
->unlocked()
->toResource();
$secret = (new \Vtiful\Kernel\Format($fileHandle))
->locked()
->hidden()
->toResource();
$fileObject->header(['input', 'formula'])
->insertText(1, 0, '可编辑', null, $editable)
->insertFormula(1, 1, '=A2*2', $secret)
->protection()
->output();