Python Forum
using openpyxl to insert an image in excel
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
using openpyxl to insert an image in excel
#1
I want to insert photos in an excel table. From:

http://openpyxl.readthedocs.io/en/latest...g-an-image

I get:

Quote:from openpyxl.drawing.image import Image
ws.add_image(img, 'A1')

So I tried in the interactive shell:

Quote:>>>from openpyxl.drawing.image import Image
>>> imXl.add_image(image, 'A2')
Traceback (most recent call last):
File "<pyshell#79>", line 1, in <module>
imXl.add_image(image, 'A2')
AttributeError: 'Workbook' object has no attribute 'add_image'

Obviously the attribute '.add_image(image, 'cell') is deprecated.

Does anyone know what it looks like now? I could switch to xwlt but then I've got to find out how that works. I know the important parts of openpyxl already now.
Reply


Messages In This Thread
using openpyxl to insert an image in excel - by Pedroski55 - Sep-08-2017, 04:43 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Excel Automation using Openpyxl pradyumnajpn 1 831 May-16-2023, 09:38 AM
Last Post: Larz60+
  openpyxl insert picture problem cools0607 2 1,614 May-03-2023, 06:48 AM
Last Post: cools0607
  is it possible to copy image from email and place into excel file? cubangt 3 1,296 Nov-30-2022, 05:11 PM
Last Post: snippsat
  Openpyxl manipulate excel write formula SamLiu 0 1,075 Nov-04-2022, 03:00 PM
Last Post: SamLiu
  openpyxl insert list with formulas Irv1n 1 1,580 Sep-16-2021, 08:10 AM
Last Post: Irv1n
  How to append a value to specific excel cell using openpyxl hobbyist 0 4,892 Mar-05-2021, 07:14 PM
Last Post: hobbyist
  Append excel sheet using openpyxl TammyP 1 2,420 Feb-02-2021, 06:32 PM
Last Post: nilamo
  Openpyxl tkinter search a value in Excel column Heathcliff_1 0 3,287 Dec-02-2020, 04:35 PM
Last Post: Heathcliff_1
  Openpyxl: Excel formula & condition formatting removed JaneTan 0 3,684 Sep-25-2020, 07:02 AM
Last Post: JaneTan
  openpyxl - How can I copy some row from an excel file and paste them in another one? aquerci 2 17,636 Jun-07-2020, 04:26 AM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020