Add Custom XML Parts and Select them by ID
Possible Usage Scenarios
Custom XML Parts are the XML data that is stored inside the Microsoft Excel documents and are used by the applications that deal with them. There is no direct way of adding them using Microsoft Excel UI at the moment. However, you can add them programmatically in various ways e.g. using VSTO, using Aspose.Cells etc. Please use Workbook.custom_xml_parts.add() method if you want to add Custom XML Part using Aspose.Cells for Python via .NET API. You can also set its ID, using the CustomXmlPart.id property. Similarly, if you want to select Custom XML Part by ID, you can use Workbook.custom_xml_parts.select_by_id() method.
Add Custom XML Parts and Select them by ID
The following sample code first adds four Custom XML Parts using Workbook.custom_xml_parts.add() method. It then sets their IDs using CustomXmlPart.id property. Finally, it finds or selects one of the added Custom XML Part using Workbook.custom_xml_parts.select_by_id() method. Please also see the console output of the code given below for reference.
Sample Code
Console Output
Found: CustomXmlPart ID Sport