In PowerPoint, I have Inserted an Excel Spreadsheet table, but the "table" only seems to be a graphicframe without a shape type and returns false when I check for a table or chart:
from pptx import Presentation
prs = Presentation('../Template.pptx')
slide = prs.slides[7]
table = slide.shapes[6]
print(table)
>>><pptx.shapes.graphfrm.GraphicFrame object at 0x063BDEB0>
print(table.shape_type)
>>>None
print(table.has_table)
>>>False
print(table.has_chart)
>>>False
Any clue how I can actually edit the data inside my table variable?
To recreate this issue, create a slide and add a table through the ribbon Insert > Table > Excel Spreadsheet. Then you can modify my script above to call the proper presentation/slide/shape.
I will add that when I create a table through Insert > Table > Insert Table... or use table = slide.shapes.add_table(3,3,x,y,cx,cy)
then table.has_table
is true. But if the table is created this way, I can't make use of key Excel features like data types and conditional formatting. You can see in the image below, the table formatted with Currency and conditional formatting is much more readable than the one without.