Error using export function

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.

回答 (1 件)

Walter Roberson
Walter Roberson 2016 年 2 月 26 日

0 投票

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.)

質問済み:

2016 年 2 月 26 日

回答済み:

2016 年 2 月 26 日

Community Treasure Hunt

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

Start Hunting!

Translated by