MoShe
MoShe

Reputation: 6427

Excel file doesn't have SharedStringTable

I tried to de-serialize all the data from the excel file to list . but when in this line:

var sharedStringTablePart = workBookPart.SharedStringTablePart;
if (sharedStringTablePart == null)
{
     // report a problem
}

sharedStringTablePart reruen null

I checked the file with open XML sdk2.0 productivity tool and I saw that the file dont have SharedStringTable

any idea why?

Upvotes: 1

Views: 1308

Answers (1)

jklemmack
jklemmack

Reputation: 3636

The SharedStringTable is only added if you have text that is not represented in-line in the file. Excel tends to use an SST, but if you have numerical values only, or some other tool generated your file with in-line strings, then you won't have an SST. You'd never "deserialize" the SST directly anyway - it's only used to display values from text fields.

Just skip/ignore it and move on.

Upvotes: 3

Related Questions