Message Boards Message Boards


Exporting Excel file with cell comments

Posted 10 years ago
1 Reply
4 Total Likes
I would like to know if it's possible to export XLSX files with cell comments.
I tryed Tooltips, but didn't worked.
data = {{Tooltip["Col01", "Tooltip Test"], "Col02", "Col03"}, {1, 2, 3}};
Export["~/desktop/data.xlsx", data]
This is the result:

This is what I need:

I'm using Mathematica 9 for Mac, so Mathematica Link for Excel is not an option.
POSTED BY: Rodrigo Murta
Posted 10 years ago
Mathematica currently cannot Export comments to basic Excel's formats. But you can export your data with comments to Excel's "XML Table" format which AFAIK is completely equivalent to the basic Excel's formats .xls and .xlsx.
The basic idea is that you can save an Excel Workbook in the "XML Table" format, then import the generated file in Mathematica by the command:
XMLData = Import["test.xml", "IncludeNamespaces" -> "Unparsed"];
Then you can find yourself how the comments are represented in the XML. It should not be too difficult to write a function for converting Tooltips into comments in such XML file.
POSTED BY: Alexey Popkov
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract