If you have ever dreamed that it will be possible to fill out an Excel cell with a picture, using Python, then you should probably reevaluate your dreams. Seriously, who dreams of something like that?
Without further dreaming, the code below will return a file named export.xlsx with my logo on it on cell B2:
from PIL import Image
wb = openpyxl.Workbook()
ws = wb.worksheets
url = 'https://www.vitoshacademy.com/wp-content/uploads/2013/07/cropped-VA-grey2.png'
my_logo = Image.open(requests.get(url, stream=True).raw)
img = openpyxl.drawing.image.Image(my_logo)
# img = openpyxl.drawing.image.Image('printing_a_picture.png')
Abd if you want to upload the picture from your PC, then uncomment this line and run it again – img = openpyxl.drawing.image.Image('printing_a_picture.png').
That’s all folks!