Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I convert Excel OpenXML shared strings to inline strings?

Tags:

xml

excel

openxml

I have a large spreadsheet in Excel 2007 OpenXML format that I want to manipulate in xml programmatically. Excel saves it using the shared strings method which, while more efficient, complicates the process. Does anyone know if there is an option buried in Excel to save using inline strings, or maybe a utility already build to place all the strings back inline within the sheet.xml again? Haven't had much luck googling and I'd rather use an existing solution rather than building my own converter if possible. Thanks.

like image 324
AgentThirteen Avatar asked Jan 14 '09 16:01

AgentThirteen


1 Answers

It should be pretty easy to do so (just iterate through though each page/row/shared string cell looking up its value in the table and then changing its value and type), but why would you want to (unless you were doing some XSLT or something)? By inlining everything, you probably increase file size. Just make sure any cell you modify you change to inline string.

like image 116
foson Avatar answered Oct 13 '22 00:10

foson