XLSX- how to get rid of the default namespace prefix x:?
03:46 29 Jul 2009

I'm generating XLSX spreadsheet using OOXML SDK, and I need to get rid of x: namespace prefix. How can I achieve this?

using (SpreadsheetDocument doc = SpreadsheetDocument.Open("template.xlsx", true))
            {
                //Save the shared string table part
                if (doc.WorkbookPart.GetPartsOfType().Count() > 0)
                {
                    SharedStringTablePart shareStringPart = 
doc.WorkbookPart.GetPartsOfType().First(); shareStringPart.SharedStringTable.Save(); } //Save the workbook doc.WorkbookPart.Workbook.Save(); }

Here, the original XLSX file is coming from Excel 2007 and doesn't have the prefix, however, after the save operation the prefix appears. How can I avoid that?

namespaces openxml-sdk openxml spreadsheetml