> For the complete documentation index, see [llms.txt](https://xlswriter-docs.viest.me/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://xlswriter-docs.viest.me/english/protection/unlock.md).

# Unlock cells

When a worksheet has edit protection enabled, this style lifts protection on specific rows, columns, or individual cells so they remain editable.

## Function Prototype

```php
unlocked();
```

## Example

```php
$config = [
    'path' => './'
];

$fileObject = new \Vtiful\Kernel\Excel($config);

$fileObject = $fileObject->fileName('tutorial.xlsx');
$fileHandle = $fileObject->getHandle();

// Build the unlocked style
$format = new \Vtiful\Kernel\Format($fileHandle);
$unlockedStyle = $format->unlocked()->toResource();

$filePath = $fileObject->header(['name', 'age'])
    ->data([
        ['wjx',   21]
    ])
    ->setRow('A2', 50, $unlockedStyle) // Unlock row 2 of the worksheet
    ->protection() // Protect the rest of the worksheet
    ->output();
```
