Export Charts from Excel as images using Python

前端 未结 5 655
灰色年华
灰色年华 2020-12-01 10:20

I have been trying to export the charts from Excel as an image file (JPG or ING) in Python. I am looking at the WIn32com. Here is what I have till now.

impor         


        
5条回答
  •  鱼传尺愫
    2020-12-01 10:54

    Nowadays I would recommend excel2img library, served me well. Make sure you have it installed (pip install excel2img)

    import excel2img
    
    excel2img.export_img("test.xlsx", "test.gif", "Sheet1", "MyNamedRange")
    

    If you don't need gridlines - just hide it on excel.

    git rep: excel2img to learn more.

提交回复
热议问题