I'm trying to add a picture (with an external relationship) to a document. It works fine if the document is blank, but if there are already pictures in the document, then I get the following exception:
"Only one instance of this type is allowed for this parent."
The line that throws it is this one:
DrawingsPart drawingsPart1 = UriPartDictionary["/xl/worksheets/sheet1.xml"].AddNewPart<DrawingsPart>("imgId1");
That's before I've added any external relationships. Why can you only have one DrawingsPart for an OpenXmlPart?
Thanks for any help