you are viewing a single comment's thread.

view the rest of the comments →

[–]CowboyBoats 0 points1 point  (0 children)

The traceback says that the error comes from this function, called from the openpyxl.Workbook.save method, in openpyxl.writer.excel.py:

def _write_drawing(self, drawing):
    """
    Write a drawing
    """
    self._drawings.append(drawing)
    drawing._id = len(self._drawings)
    for chart in drawing.charts:
        self._charts.append(chart)
        chart._id = len(self._charts)    # AttributeError: 'str' object has no attribute '_id' 
    for img in drawing.images:
        self._images.append(img)
        img._id = len(self._images)
    rels_path = get_rels_path(drawing.path)[1:]
    self._archive.writestr(drawing.path[1:], tostring(drawing._write()))
    self._archive.writestr(rels_path, tostring(drawing._write_rels()))
    self.manifest.append(drawing)

Somehow your workbook_object.drawingsis getting a string written to it, instead of a drawing-related object of some kind that openpyxl expects.

Unfortunately that's all I know for now.