With help from the documentation, here and StackExchange, I have figured out how to:
- Export data to multiple named sheets to Excel
- Export data and functions to a single unnamed sheet
- Export data and functions to multiple unnamed sheets
But, I cannot figure out how to export both data and functions to multiple unnamed sheets.
Here is what I have so far:
Export[
"test.xlsx",
<|
"Data" ->
{
{{1., 2.}, {3., 4.}},
{{5., 6.}, {7., 8.}}
},
"Formulas" -> {
{{"", "", "A1+B1"}, {"", "", "A2+B2"}},
{{"", "", "A1+B1"}, {"", "", "A2*B2"}}
}
|>,
"Rules"
];
This exports data and formulas to two sheets. I spent a couple of hours trying different ways to name the sheets, but so far I either get gibberish in the Excel file or an error such as:
- Export: {Data, Sheets} is not a valid set of export elements for XLSX.
It would be great to have some real-world examples in the documentation.