Newline character in XML cell reference when creating xlsx from XMLzipped files

  • Thread starter Thread starter ian.osullivan
  • Start date Start date
I

ian.osullivan

I'm a programmer creating an xlsx file via the generation of all XML files required and zipping them to create the xlsx file. All is working fine but my question is How do I put a newline characgter into a cell in my xml? Every attempt so far only outputs a string.

Thanks
 
ian.osullivan said:
I'm a programmer creating an xlsx file via the generation of all XML
files required and zipping them to create the xlsx file. All is working
fine but my question is How do I put a newline characgter into a cell in
my xml? Every attempt so far only outputs a string.

A literal newline (\r\n) in the source should do it. Try creating a new
workbook, enter a test string ("foo[ALT+ENTER]bar"), then save the workbook
and view the source outside of Excel. I did so, and got this in Book1.xlsx\xl
\sharedStrings.xml:

Line Data
1 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2 <sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"
count="1" uniqueCount="1"><si><t>foo
3 bar</t></si></sst>

(Ignore word wrap and pay attention to the line numbers.)
 
Back
Top