Delete worksheets in Excel file
Version 1.1.0.0 (4.28 KB) by
Guilherme Coco Beltramini
Delete selected worksheets or all empty worksheets in Excel file
Delete worksheets in Excel file
USAGE
xls_delete_sheets(xlsfile)
xls_delete_sheets(xlsfile,sheets)
INPUT
- XLSFILE: name of the Excel file
- SHEETS: cell array with the worksheet names, or matrix with positive integers to tell which worksheets are going to be protected. If SHEETS=[], all empty sheets will be deleted.
OUTPUT
- XLSFILE will be edited
Cite As
Guilherme Coco Beltramini (2026). Delete worksheets in Excel file (https://www.mathworks.com/matlabcentral/fileexchange/42054-delete-worksheets-in-excel-file), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2010a
Compatible with any release
Platform Compatibility
Windows macOS LinuxCategories
Find more on Spreadsheets in Help Center and MATLAB Answers
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.
