File Exchange

image thumbnail

RemoveSheet123 - remove default Excel sheets

version (4.96 KB) by Noam Greenboim
Remove default sheets ("sheet1" ,"sheet2", "sheet3") from an Excel file


Updated 01 Apr 2015

View License

Editor's Note: This file was selected as MATLAB Central Pick of the Week

When a new Excel file is created (whether using Matlab or Excel), it always contains 3 defaults sheets. Their names are depended on the language Excel is defined. In English, it's "sheet1", "sheet2" and "sheet3".
It is useless when writing (with XLSWRITE) to a specific sheet.
This function remove those sheets, regardless of their contents.
The code is based on Jiro Doke's answer (link below), and built-in Matlab functions.

Cite As

Noam Greenboim (2020). RemoveSheet123 - remove default Excel sheets (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (5)

Worked perfectly, thanks!

Paul Smits

Quick and easy.

David Logan

Nice! But as The Pick of the Week says
"Note: This only works on Windows because it relies on the Excel API."

Oren Rosen

MATLAB Release Compatibility
Created with R2013a
Compatible with any release
Platform Compatibility
Windows macOS Linux