MATLAB: Is there a way to use XLSWRITE to create a backward compatible Excel file

MATLAB

I am using Microsoft Excel 2007, and when using XLSWRITE I am writing to the 2007-only XLSX format. However, my users who still use Microsoft Office 2003 cannot open the XLSX file.

Best Answer

The file extension you provide as part of filename argument to XLSWRITE determines the Excel format that xlswrite uses for the new file. An extension of .xls creates a worksheet compatible with Excel 97-2003 software. Use extensions .xlsx, .xlsb, or .xlsm to create worksheets in Excel 2007 file formats.
For example, to create a .xls file compatible with Microsoft Excel 97-2003, the following XLSWRITE call may be used:
xlswrite('foo.xls',A);
On the other hand, to create a .xlsx file for use with Microsoft Excel 2007, the following may be uased:
xlswrite('foo.xlsx',A);
If you are using Microsoft Excel 2010, you can do the same starting with MATLAB R2010b (7.11).