File Exchange

image thumbnail

Delete Excel Workbook Sheets (Sheet 1 delete ) using Matlab

version 1.0.1 (1.69 KB) by Pruthvi G
This Script is intended to Delete provided sheets , It can be an Array of sheets also.

24 Downloads

Updated 13 Apr 2020

View Version History

View License

%%**********************************************************************************************************
% Name : Delete_sheets_Excel
% Author : Pruthvi Raj G :: (9677066394 :: www.prudhvy.com )
% Version : Version 1.0 - 2011b Compactible
% Description : Deleting Excel Sheets required after writing data to Excel.
% Input : File_Name with path included , Sheet_name / Sheet_names.
% Date : 22-April-2019
%
% Examples : Delete_sheets_xcel('D:\Pruthvi\Test_file.xls',{'Sheet1','Sheet2'}) %To delete 2 sheets
% Delete_sheets_Excel('D:\Pruthvi\Test_file.xls','Sheet1')
% Delete_sheets_Excel('D:\Pruthvi\Test_file.xls') % Takes 'Sheet1' as Default
%************************************************************************************************************

Cite As

Pruthvi G (2020). Delete Excel Workbook Sheets (Sheet 1 delete ) using Matlab (https://www.mathworks.com/matlabcentral/fileexchange/71329-delete-excel-workbook-sheets-sheet-1-delete-using-matlab), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (3)

Anna Zeng

Thank you so much! Solved my problem.
But it didn't work until I add a line to disable display alerts.
objExcel.DisplayAlerts = false;
Hope this helps.

Nachiket Wadwankar

Solved my purpose. Very useful and simple.
Thank you

Chang hsiung

MATLAB Release Compatibility
Created with R2011b
Compatible with R2011b to R2019a
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!