Search code examples
c#excelopenxmlopenxml-sdk

Add a custom namespace and use it in openxml excel via c# openxml sdk


Is there an example to add a custom namespace

e.g.

xmlns:bluh = "http://www.bluhbluh.com"

at Workbook/WorkbookPart/SpreadSheetDocument level

using a C# OpenXml SDK?


Solution

  • You can't add a custom namespace to the spreadsheet, word document, etc... OOXML format doesn't allow it.

    see the blog post by Gray Knowlton http://blogs.technet.com/b/gray_knowlton/archive/2009/12/23/what-is-custom-xml-and-the-impact-of-the-i4i-judgment-on-word.aspx

    archive link: https://web.archive.org/web/20091226044101/http://blogs.technet.com/gray_knowlton/archive/2009/12/23/what-is-custom-xml-and-the-impact-of-the-i4i-judgment-on-word.aspx