When I add an image to the excel file, the excel file has unreadable content.
The excel file and the png file are both valid files.
openpyxl is version 2.5.10
The excel file and the png file are both valid files.
openpyxl is version 2.5.10
import openpyxl from openpyxl import load_workbook from openpyxl import Workbook from openpyxl.drawing.image import Image from openpyxl.utils import coordinate_from_string openpyxl_version = openpyxl.__version__ print(openpyxl_version) #to see what version I'm running png_loc = 'test.png' wb = load_workbook('test.xlsx') ws = wb.active my_png = openpyxl.drawing.image.Image(png_loc) ws.add_image(my_png, 'B3') wb.save('test.xlsx')
Larz60+ write May-13-2021, 12:16 AM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Fixed for you this time. Please use bbcode tags on future posts.
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Fixed for you this time. Please use bbcode tags on future posts.