Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I try to export two grid in a same xls file, naming the sheets. This is an exemplification of my issue, and it doesn't work.

m = Grid[Table[i - j, {i, 3}, {j, 4}]];
Export["m.xls", m]

it works correctly, but if I try this code, naming the sheet, it doesn't work

Export["m.xls", {"MySheet" -> m}]

Thanks

share|improve this question

The Grid is the reason why it does not work! Try this for multiple sheets

x = RandomReal[1, {5, 5}];
y = RandomInteger[{-10, 10}, {5, 5}];
Export[$UserBaseDirectory <> "\\file.xlsx", {"Real" -> y,"Integer" -> y}]

In your case

m=Table[i - j, {i, 3}, {j, 4}];
Export[$UserBaseDirectory <> "\\file.xlsx","MySheet" -> m]
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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