MATLAB Answers

Is it possible to make XLSREAD and XLSWRITE compatible with Mac (when Excel is installed) on MATLAB 7.12 (2011a)?

80 views (last 30 days)
I would like to use XLSREAD and XLSWRITE on Mac OS X (when Excel is installed). However, when I call XLSWRITE, for example, I get the following warning message, and only a comma-separated (CSV) data file is created:
Warning: Could not start Excel server for export.
XLSWRITE attempts to file in CSV format.
> In xlswrite at 157
In addition, arguments such as sheet range, when passed to XLSWRITE, have no effect.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 28 Feb 2017
The ability to use XLSWRITE on a Mac system to create Excel files is not available in MATLAB 7.12 (R2011a). XLSWRITE instead creates CSV (comma-separated value) files when used on a Mac, and provides the same functionality as it does on Linux and UNIX platforms.
The full functionality of XLSWRITE depends on the ability to instantiate Microsoft Excel as a COM server. COM is a technology developed for Windows platforms and is not available for the Mac. Thus XLSWRITE as well as XLSREAD have limited functionality on the Mac platform and work in basic mode.
Support for XLSREAD on Mac OS X may be considered for a future release of MATLAB. Unfortunately, there are no workarounds for the issue at this time.

  0 Comments

Sign in to comment.

More Answers (3)

Stefan Bleeck
Stefan Bleeck on 24 May 2017
it's not 2017. Still not possible??

  1 Comment

Walter Roberson
Walter Roberson on 24 May 2017
I suggest you use writetable() if your data can be constructed as a table object, as it can write .xls and .xlsx
Excel for Mac does not even have DCOM compiled in, so even if Mathworks were to compile against DCOM libraries for Unix (there are some, it turns out), Excel for Mac would not be listening.

Sign in to comment.


René Moerman
René Moerman on 2 May 2019
it's not 2019. Still not possible??

  2 Comments

Guillaume
Guillaume on 2 May 2019
The version of matlab is irrelevant. The technology that xlswrite relies on is only available on Windows.
Matlab has moved to writetable, writematrix, etc. which do support writing excel files even on Macs. I think it's unlikely that xlswrite will ever be updated to use the same code, as it's been superseded by these functions.
Walter Roberson
Walter Roberson on 3 May 2019
The technology is available through uncommon add-ons for Mac and Linux, but the Microsoft Office family for Mac do not have the technology enabled, so even if Mathworks were to compile against those add-on libraries, it would still not be able to talk to Excel using the techology.

Sign in to comment.


Methene Cutad
Methene Cutad on 12 Mar 2020
its not 2020. Still not possible?

  3 Comments

Guillaume
Guillaume on 12 Mar 2020
As has been said above, it will never be possible. The restriction is not matlab, it's excel. Despite the similarities, excel on Mac uses completely different technology that cannot be interfaced with the same way as it's done on Windows.
As has also been said, readtable, readmatrix, and co. all support reading/writing excel files and don't even need excel installed.
Walter Roberson
Walter Roberson on 12 Mar 2020
Note that Microsoft is distinctly moving away from having a Mac product as such, in favour of their cloud-based Office 365. It is thus unlikely that ActiveX technology will ever get enabled for the Mac product.

Sign in to comment.

Products


Release

R2011a