How to make "xlswrite" "writetable" ACTUALLY work for output excel files?
Show older comments
seems that people had the same issues in the past and there is no well-established solutions.
I have 2015a Matlab on a mac and got my excel from my university network (download and install). This is the case for most of students and faculty members. However, xlswrite says
"Warning: Could not start Excel server for export. XLSWRITE will attempt to write file in CSV format. > In xlswrite (line 174)"
writetable says: "Error using writetable (line 106) Could not start Excel server for export. Export to a text file instead."
I am very shocked about this, since these two commands are so essential. Please help.
Henry
Accepted Answer
More Answers (1)
Yang
on 29 Apr 2025
You can add a FileType definition in the statement as follows:
filename = sprintf('Schedule for %s.xlsx', data);
writetable(table, filename, 'FileType', 'spreadsheet');
1 Comment
Walter Roberson
on 29 Apr 2025
writetable() by default examines the file extension in order to detect that xlsx was requested, and it knows that xlsx is Filetype spreadsheet. So specifying FileType spreadsheet for writetable() is not necessary . Specifying it might be a nice bit of self-documenting code for certainty, but it has never been necessary when .xlsx is specified as the file extension.
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!