ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Newline character in XML cell reference when creating xlsx from XMLzipped files (https://www.excelbanter.com/excel-programming/445273-newline-character-xml-cell-reference-when-creating-xlsx-xmlzipped-files.html)

[email protected]

Newline character in XML cell reference when creating xlsx from XMLzipped files
 
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

Auric__

Newline character in XML cell reference when creating xlsx from XML zipped files
 
ian.osullivan wrote:

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<tfoo
3 bar</t</si</sst

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

--
- Your mother was a cash register!
- And she turned a tidy profit.


All times are GMT +1. The time now is 09:37 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com