I have an excel file and in one row there is an image in each cell. I'd like to give the cell like A2 to excel and wants to get back the image in this cell, but I don't get it. I figured out to use win32com instead of xlrd. This code is running, but it's not the code I need:
import win32com.client as win32
x = win32.Dispatch("Excel.Application")
wb = x.Workbooks.Open("Test.xlsx")
ws = wb.Sheets(1)
for i in ws.Shapes:
print(i.TopLeftCell.Address)
wb.Close(True)
This code prints correctly each cells like A2, A3, A4,..., where an image is placed. So in general it recognizes an image. But how can I save a special image for example in cell A2? I tried something like
img = ws.Shapes(1).CopyPicture()
like shown here but it didn't work, img is empty.
It's not necessary to use win32com as long as it works, it seemed to be the right basic approach, but I'm open to alternative suggestions