I want to add some object to my excel sheet, I'm using openpyxl, In excel you do it by: Insert->Object
Is there a way to do it thru openpyxl or any other excel tool that working with python?
I want to add some object to my excel sheet, I'm using openpyxl, In excel you do it by: Insert->Object
Is there a way to do it thru openpyxl or any other excel tool that working with python?
import openpyxl
wb = openpyxl.Workbook()
ws = wb.worksheets[0]
picture = openpyxl.drawing.Image('/path/to/picture')
picture.anchor(ws.cell('cell to put the image'))
ws.add_image(picture)
wb.save('whatever you want to save the workbook as')
This code of course refers to creating a new workbook and adding the image into it. To add the image to your preexisting workbook you would obviously just load that workbook using load_workbook.