---
title: "remove_sheet_protection"
---

[< Back to Reference](../reference.qmd) | [View source](https://codeberg.org/usrbinr/tidychain/src/branch/main/R/read_calc_chain.R#L398)

# `remove_sheet_protection()`

Remove Sheet Protection from Excel File

## Usage

```r
remove_sheet_protection(path, output = NULL)
```

## Arguments

| Argument | Description |
|----------|-------------|
| `path` | Path to the source .xlsx file. |
| `output` | Path for the output file. If NULL, appends "_unprotected" to filename. |

## Value

Invisibly returns the output path.

## Description

Creates a copy of an Excel file with all sheet protection removed.
No password is required - sheet protection is simply stripped from the XML.

## Details

Excel sheet protection is NOT encryption - it's just a flag in the XML that
tells Excel to prevent edits. This function removes that flag, allowing
full access to the sheet contents.

This does NOT work on encrypted files (those protected with
"Encrypt with Password"). Use `is_encrypted_xlsx()` to check.

## Examples

```r
## Not run: 
# Remove protection and save to new file
remove_sheet_protection("protected.xlsx", "unprotected.xlsx")

# Auto-generate output filename
remove_sheet_protection("protected.xlsx")
#> Saved to: protected_unprotected.xlsx

## End(Not run)
```

