2
$\begingroup$

Background (simplified): When I export data to Excel like

 Export["voorbeeld.xls", {{{0.5, 0.166667}, {0.666667, 
0.166667}, {0.166667, 0.333333}, {0.333333, 0.333333}, {0.5, 
0.333333}, {0.666667, 0.333333}, {0.833333, 0.333333}, {0.166667, 
0.5}, {0.333333, 0.5}, {0.5, 0.5}, {0.666667, 0.5}, {0.833333, 
0.5}, {0.5, 0.666667}, {0.666667, 0.666667}}, {{1., 2., 6., 
5.}, {3., 4., 9., 8.}, {4., 5., 10., 9.}, {5., 6., 11., 10.}, {6.,
 7., 12., 11.}, {10., 11., 14., 
13.}}, {{RGBColor[0.9308155947203784, 0.9308155947203784, 
 0.9308155947203784]}, {RGBColor[1, 0, 0]},    RGBColor[0., 1., 
0.14062714579995422], {RGBColor[1., 0.11317616540779736, 
 0.000015259021896696422]}, {RGBColor[1., 0.9651483939879454, 
 0.38461890592813003]}, {RGBColor[0.9685511558709087, 
 0.9685511558709087, 0.9685511558709087]}}}]

I would expect the data to be inserted into cells but Excel uses just 3 cells. When I imported the same data the three main lists were stored in separate sheets in Excel.

Example 2:

list3={{RGBColor[0.9308155947203784`,0.9308155947203784`,0.9308155947203784`]},
 {RGBColor[1,0,0]},RGBColor[0.`,1.`,0.14062714579995422`], 
 {RGBColor[1.`,0.11317616540779736`,0.000015259021896696422`]},
 {RGBColor[1.`,0.9651483939879454`,0.38461890592813003`]},
 {RGBColor[0.9685511558709087`,0.9685511558709087`,0.9685511558709087`]}}

Export["voorbeeld.xls",list3] creates a column with RGB values.
Export["voorbeeld.xls",{list3}] creates one cell.
Does this help?

Question: is there a solution / workaround for this issue?

Example 3:

 list3={{RGBColor[0.9308155947203784`,0.9308155947203784`,0.9308155947203784`]},      {RGBColor[1,0,0]},RGBColor[0.`,1.`,0.14062714579995422`],{RGBColor[1.`,0.11317616540779736`,0.000015259021896696422`]},{RGBColor[1.`,0.9651483939879454`,0.38461890592813003`]},{RGBColor[0.9685511558709087`,0.9685511558709087`,0.9685511558709087`]}}
$\endgroup$
3
  • $\begingroup$ I presume because you have US settings in your OS. $\endgroup$ Apr 17, 2012 at 13:55
  • $\begingroup$ SORRY. I simplified if too far. I will EDIT the question without assumptions about the cause. $\endgroup$ Apr 17, 2012 at 14:04
  • $\begingroup$ See my edit. RGBColor can be stored in separate cells. $\endgroup$ Apr 17, 2012 at 14:38

1 Answer 1

6
$\begingroup$

The last "sheet" in

data = {{{0.5, 0.166667}, {0.666667, 0.166667}, {0.166667, 
 0.333333}, {0.333333, 0.333333}, {0.5, 0.333333}, {0.666667, 
 0.333333}, {0.833333, 0.333333}, {0.166667, 0.5}, {0.333333, 
 0.5}, {0.5, 0.5}, {0.666667, 0.5}, {0.833333, 0.5}, {0.5, 
 0.666667}, {0.666667, 0.666667}}, {{1., 2., 6., 5.}, {3., 4., 9., 
 8.}, {4., 5., 10., 9.}, {5., 6., 11., 10.}, {6., 7., 12., 
 11.}, {10., 11., 14., 
 13.}}, {{RGBColor[0.9308155947203784, 0.9308155947203784, 
 0.9308155947203784]}, {RGBColor[1, 0, 0]}, 
RGBColor[0., 1., 
 0.14062714579995422], {RGBColor[1., 0.11317616540779736, 
 0.000015259021896696422]}, {RGBColor[1., 0.9651483939879454, 
 0.38461890592813003]}, {RGBColor[0.9685511558709087, 
 0.9685511558709087, 0.9685511558709087]}}}

(i.e. list3) is the source of the problem. If you fix the third element RGBColor[0., 1., 0.14062714579995422] and put {RGBColor[0., 1., 0.14062714579995422]} like you have for the others it exports correctly, which each element of data as a table on its own sheet.

Also, you can always force it to Export sheets, by specifying:

Export["file.xls", data, "Sheets"]
$\endgroup$
3
  • $\begingroup$ Oke, I will try NOW $\endgroup$ Apr 17, 2012 at 14:39
  • $\begingroup$ Yes, how embarrassing, a plain coding BUG. Yikes! Thank you very much. $\endgroup$ Apr 17, 2012 at 14:42
  • 2
    $\begingroup$ It happens to all of us! $\endgroup$
    – Eli Lansey
    Apr 17, 2012 at 14:44

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.