Protect or unprotect worksheets in Excel file
USAGE
xls_protect_sheets(xlsfile,sheets,action)
xls_protect_sheets(xlsfile,sheets,action,password)
INPUT
- XLSFILE: name of the Excel file
- SHEETS: cell array with the worksheet names, or matrix with positive integers, or 'all', to tell which worksheets are going to be protected
- ACTION: 'protect' or 'unprotect'
- PASSWORD: password to protect or unprotect the worksheet
OUTPUT
- XLSFILE will be edited
Cite As
Guilherme Coco Beltramini (2026). Protect or unprotect worksheets in Excel file (https://uk.mathworks.com/matlabcentral/fileexchange/42055-protect-or-unprotect-worksheets-in-excel-file), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
Tags
Acknowledgements
Inspired by: Check if XLS file is open and close it
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
