You can rename an Excel sheet using the "Name" property of a sheet object. For example the following renames the first sheet of an Excel file:
filename = 'C:\SomeExcelFile.xls';
Excel = actxserver('Excel.Application');
Excel.Visible=1;
Workbook = Excel.Workbooks.Open(filename);
Sheets = Excel.ActiveWorkbook.Sheets;
Sheets.Item(1).Name = 'This is sheet 1';
The following code then saves the Workbook, quits Excel and removes the COM server:
Workbook.Save();
Excel.Quit();
Excel.delete();
clear Excel;
clear Workbook;
clear Sheets;
Best Answer