#Write PNG file to existing worksheet
from openpyxl import Workbook
from openpyxl.drawing.image import Image
xfile = openpyxl.load_workbook('Things.xlsx')
sheet = xfile.get_sheet_by_name('Types of Cats')
img = Image('Typesofcats.png')
sheet.add_image(img, 'L6')
sheet1 = xfile.get_sheet_by_name('Types of Dogs')
img1 = Image('Typesofdogs.png')
sheet1.add_image(img1, 'I6')
sheet2 = xfile.get_sheet_by_name('Types of Pigs')
img2 = Image('Typesofpigs.png')
sheet2.add_image(img2, 'I6')
xfile.save('Things.xlsx')
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
文章由极客之音整理,本文链接:https://www.bmabk.com/index.php/post/101575.html