Clear Filters
Clear Filters

Error using export function

3 views (last 30 days)
Alessandro
Alessandro on 26 Feb 2016
Answered: Walter Roberson on 26 Feb 2016
Hi everyone, I'm trying to export a file to excel (I'm using a MacBook and I have the licence for excel) using the function export. The code I wrote is the following:
export(SumStats.statsDR,'XLSFile','SumStats.statsDR.xlsx')
However, Matlab gives me the following error:
Error using dataset/export (line 108) Could not start Excel server for export. Export to a text file instead.
Error in untitled (line 227) export(SumStats.statsDR,'XLSFile','SumStats.statsDR.xlsx');
Is someone able to tell me what is wrong there? Or how I can export the file to a txt file using the same function 'export'?
Thanks for the help.

Answers (1)

Walter Roberson
Walter Roberson on 26 Feb 2016
You can only export to xls or xlsx if you are using MS Windows with Excel installed. There is no Mathworks provided method to write xls or xlsx on OS-X, no matter whether you have Excel or not. (This is because the export method requires using ActiveX to communicate with Excel.)

Community Treasure Hunt

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

Start Hunting!