11
$\begingroup$

When I want to Export["text.xlsx", data] where data is a matrix with 500 columns and 10000 rows, I get the error message:

Export::toomany3: "Cannot export to !(\"XLSX\"). The number of columns exceeds the limit of this format."

However, if I write the data as csv and load it into excel, everything works. Is there a way to write the data of this size to xlsx directly?

Test sample:

data = RandomReal[{-1, 1}, {10000, 500}];
Export["test.xlsx", data]

This happens with Mathematica 8 and 9 and 10.

$\endgroup$
11
  • $\begingroup$ Have you tried xls? Probably best to just use csv. If MMA can't export as xlsx then unless they patch it I don't think you can solve it. $\endgroup$
    – s0rce
    Commented Mar 8, 2013 at 18:00
  • 1
    $\begingroup$ Are you sure the v9 tag is appropriate? This would suggest that it works in v8... Since xlsx is "just" an xml file you could in theory get around this. But definitely not worth the effort. Also, contact [email protected] and report this as a bug. superuser.com/questions/366468/… $\endgroup$
    – Ajasja
    Commented Mar 8, 2013 at 18:08
  • 1
    $\begingroup$ Should we tag as bug? $\endgroup$
    – Ajasja
    Commented Mar 8, 2013 at 22:51
  • 1
    $\begingroup$ @SjoerdC.deVries Excel has enough bugs to claim compatibility with any other buggy software $\endgroup$ Commented Mar 8, 2013 at 23:53
  • 10
    $\begingroup$ @AndreasLauschke I don't agree: the xlsx file format specification supports 1,048,576 rows and 16,384 columns. So in mma you either have to mention you don't fully support it, or fix the limits. Whether it is a good idea to export such large data to xlsx or not is beside the point. $\endgroup$
    – Ajasja
    Commented Mar 9, 2013 at 16:05

2 Answers 2

4
$\begingroup$

I wrote to Wolfram's support and they answered with a link about "Excel 2007 features that are not supported in earlier versions of Excel". I can not see clearly how this connects to Mathematica's support of Excel 2007 features. However, my suggestion to fully support XLSX has been forwarded to Wolfram's developers.

$\endgroup$
1
  • $\begingroup$ Yes, the support answer is not useful at all. Looks like the Wolfram developers are still very busy with fully supporting XLSX, since in 10.0.1 it seems not to work (at least on Windows). $\endgroup$ Commented Oct 15, 2014 at 11:19
1
$\begingroup$

According to

http://office.microsoft.com/en-us/excel-help/excel-specifications-and-limits-HP005199291.aspx

this is no bug in MM. It is the spec limit of an Excel sheet. Thus you have to split your export. Maybe you want to rethink the data structure?

Edit: Applies to Excel 2003. For excel 2010 the limits were extended:

http://office.microsoft.com/en-us/excel-help/excel-specifications-and-limits-HP010342495.aspx?CTT=5&origin=HP005199291

Thus it is not exactly a bug. It is more a feature request since Wolfram should adopt to the new limits.

$\endgroup$
2
  • 3
    $\begingroup$ Actually 2003 does not natively support xlsx files, the file format we are talking about. $\endgroup$
    – Ajasja
    Commented Mar 9, 2013 at 16:01
  • 6
    $\begingroup$ Even if they don't wish to add support for more than 255 columns, the objection that "the number of columns exceeds the limit of this format" is clearly incorrect--thus I think calling it a bug is appropriate in this case. Limitations placed on other formats by Mathematica's capabilities rather than the format itself are clearly stated in the documentation, which obviously is not the case here. $\endgroup$ Commented Mar 9, 2013 at 20:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.