Add, remove or change a worksheet
xlide_manage_sheetAdd, remove, rename, move, hide, show, protect, or unprotect worksheets in Excel files. Renaming updates formulas; removing breaks references, so confirm first.
Instructions
Adds, removes, renames, moves, hides, shows, protects or unprotects a worksheet. Renaming rewrites the formulas and defined names that referred to the old name, so nothing breaks. Removing a sheet takes its cells, tables and everything on it, and formulas elsewhere that pointed at it become #REF!, which has no undo: ask the user first. Protecting a sheet stops editing in Excel; it is not a security boundary and the password is trivially recovered. Works on .xlsx, .xlsm, .xlam.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| index | No | For add and move: 0-based position. -1 means the end. | |
| sheet | No | The sheet to act on. For add, the name to give the new one. | |
| action | Yes | add, remove, rename, move, hide, show, protect or unprotect. | |
| new_name | No | For rename: the new name. | |
| password | No | For protect: an optional password. Excel's sheet password is obfuscation, not encryption, so do not use one the user relies on elsewhere. | |
| file_path | Yes | Absolute path to the Excel file. | |
| very_hidden | No | For hide: hide it so that Excel's own Unhide dialog does not list it. Only the VBA editor can bring it back. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||