Naming sheets with xlswrite
33 views (last 30 days)
Show older comments
Naming sheets with xlswrite. As simple as that. I cannot find the way.
Thank you!
0 Comments
Accepted Answer
Guillaume
on 19 Jul 2019
xlswrite(filename,A,sheet) writes to the specified worksheet.
4 Comments
Guillaume
on 19 Jul 2019
No, if the workbook doesn't exist already xlswrite will typically create it with 3 worksheets named 'Sheet1' to 'Sheet3'. This can be reduced to just one sheet in the options of excel but excel does not allow the creation of workbooks without any sheet.
You can delete that worksheet afterward with the COM interface:
excel = actxserver('Excel.Application');
excel.DisplyAlerts = false;
workbook = excel.Workbooks.Open('fullpathtotheexcelfile.xlsx');
workbook.Worksheets.Item('Sheet1').Delete;
workbook.Save;
excel.Quit;
More Answers (1)
See Also
Categories
Find more on Spreadsheets in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!