Collez l'image dans la plage A1 à G10.
import openpyxl
workbook = openpyxl.load_workbook(insert.xlsx)
sheet = workbook['Sheet1']
img = openpyxl.drawing.image.Image(img.png)
img.width = 72 * 7
img.height = 25 * 10
sheet.add_image(img, 'A1')
workbook.save(insert.xlsx)
Collez l'image dans la plage de K3 à T15.
workbook = openpyxl.load_workbook(insert.xlsx)
sheet = workbook['Sheet1']
img = openpyxl.drawing.image.Image(img.png)
img.width = 72 * 10
img.height = 25 * 13
sheet.add_image(img, 'K3')
workbook.save(insert.xlsx)
Collez l'image dans la plage C13 à D21.
workbook = openpyxl.load_workbook(insert.xlsx)
sheet = workbook['Sheet1']
img = openpyxl.drawing.image.Image(img.png)
img.width = 72 * 2
img.height = 25 * 9
sheet.add_image(img, 'K3')
workbook.save(insert.xlsx)
https://allabout.co.jp/gm/gc/297706/ https://qiita.com/HirotakaKikushima/items/a42e3e94273247199b9a
Recommended Posts