AI generated content. This answer was created with AI from ChatGPT
The issue you're facing stems from the fact that the pivotSource
and pivotOptions
elements, while used in Office Open XML files, are not part of the main schema at:
http://schemas.microsoft.com/office/drawing/2012/chart
What's Going On?
You're encountering custom Microsoft Office extensions—proprietary additions to the Open XML standard. These elements (pivotSource
, pivotOptions
, and pivotOptions16
) are often defined in non-public or partially documented schemas, and unfortunately, not all of them are available in the Open Specifications documentation.
What You Can Do
- Search Microsoft Open Specifications: You already tried: https://learn.microsoft.com/en-us/openspecs/office_standards/ms-odrawxml/ Unfortunately, not all elements used in Office-generated files are documented there.
Use Office2013+ Schema Files: These might live under internal namespaces or come from the Office 2013+ additions. The full schema may only be available via Office schema downloads provided by Microsoft:
https://www.microsoft.com/en-us/download/details.aspx?id=30425 (Office 2013 schema)
[https://www.microsoft.com/en-us/download/details.aspx?id=49030](https://www.microsoft.com/en-us/download/details.aspx?id=49030) (Office 2016 schema)
**Use Tools like Open XML SDK Reflector**: The [Open XML SDK Productivity Tool](https://github.com/OfficeDev/Open-XML-SDK) can inspect and decompile document parts to show how Office applications interpret these unknown tags.
**Reverse Engineer from Examples**: Since Office apps can read these tags just fine, sometimes your best bet is to inspect working `.xlsx` files and reverse-engineer how these tags are used.
```---
Specific Notes
From your XML snippet:
```xml
<cl5:pivotSource>
<cl5:name>[0. VLR Data Tool.xlsx]PivotChartTable2</cl5:name>
<cl5:fmtId val="0"/>
</cl5:pivotSource>
The namespace cl5
corresponds to:
xmlns:cl5="http://schemas.microsoft.com/office/drawing/2012/chart"
But this namespace doesn't publicly define pivotSource
or pivotOptions
. These are likely private Microsoft extensions, used internally by Excel.
Recommendation
If you need to work with these elements programmatically, the most robust approach is:
Use Open XML SDK to interact with them.
Treat these elements as opaque/custom XML unless you're targeting a very specific scenario (e.g., modifying known fields in Excel).
Document and preserve working examples, as there's no guarantee of forward compatibility.
Would you like help inspecting a .xlsx
file with these elements using code or Open XML SDK?