Skip to content

pictures.add does not seem to change width and height if called in loop #1491

Description

@nikolasharing

OS: Windows 10

Versions of xlwings, Excel and Python: 0.21.4, Office 365, Python 3.8.2

When I call pictures.add it does not seem to change width and height of the second and further pictures if called in a loop. It could be related to:

https://stackoverflow.com/questions/65688768/why-are-the-properties-height-and-width-not-adjusting-the-picture-size-in-ex

Include a minimal code sample to reproduce the issue (and attach a sample workbook if required!)

plot_size = 200

if plot_bool==True:
    for plot in plots_sheet.pictures: plot.delete()
    for count,plot in enumerate(plot_list):
        plots_sheet.pictures.add(plot, left=count*plot_size,width=plot_size,height=plot_size)

## with the following code, the height and width is actually changed for all pictures:
# for pic in plots_sheet.pictures:
#     pic.height = plot_size
#     pic.width  = plot_size

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions