Error using export function
1 view (last 30 days)
Show older comments
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.
0 Comments
Answers (1)
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.)
You may wish to try out http://www.mathworks.com/matlabcentral/fileexchange/38591-xlwrite--generate-xls-x--files-without-excel-on-mac-linux-win from the File Exchange
0 Comments
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!