[Python] How to copy a picture cell using python with xlwings?

Discussão em 'Python' iniciado por Stack, Agosto 24, 2025.

  1. Stack

    Stack Membro Participativo

    i try to copy the picture cells in column B using xlwings with the following code-snippet to first read all the images:

    import os import sys import xlwings as xw

    path = os.path.abspath(os.path.dirname(sys.argv[0]))
    fn = os.path.join(path, "Interactive Price List-Schnellstartneu (1).xlsx") wb = xw.Book (fn) ws = wb.sheets[0]
    inpPics = ws.pictures print(len(inpPics))

    But it seems with this statement i only get the image at the upper left side and not the icons from column B.

    This is how the cell look like in exel when i select eg. B12:

    [​IMG]

    And this is how the overall excel-sheet looks like with images i need in column B

    [​IMG]

    Is there any way to get the pictures from column B using xlwings (and afterward copying them for example to another excel-sheet)?

    Continue reading...

Compartilhe esta Página