Shared strings are basically a space saving mechanism. Regarding your questions:
A1 . You cannot manually create shared rows using the Excel user interface. This is because Excel always saves any text as a common string by default.
A2 . As mentioned, this is a space saving mechanism. Excel 2007/2010/2013 uses the Open XML format, which is basically a bunch of XML files zipped together. It can also be a facilitation of links. You just need to access the index, just like you are referencing the index of an array of strings. (But XML is essentially verbose, so I suspect it in order to save space).
Say you have the text “This is a very long line” in cell A1 of the “FirstSheet”. Say you also have the same text in cell B7 of the SecondSheet. Excel stores “This is a very long text” in the table of shared lines as a single record, say index 5. In cell A1, “FirstSheet”, the Open XML SDK class cell will contain only “5” as CellValue. In cell B7, "SecondSheet", the SDK cell will also contain "5".
Basically, CellValue only supports an index in a common row table. Here's how you saved space. It is assumed that the text is duplicated both on a sheet and on different sheets.
A3 . Go for general lines if you understand how to make it work. If not, just set the actual text in the Cell class to CellValue (Cell.DataType as CellValues.String instead of CellValues.SharedString).
Vincent tan
source share