none
Bug when moving groupped charts RRS feed

  • Question

  • There seems to be a bug when programmatically moving charts, that have been grouped. Here are the steps:

    1. Insert two charts.
    2. Select both charts and group them (right click Group -> Group).
    3. Set zoom to something other than 100% (it works correctly on 100%).
    4. From VBA (or VSTO) move one of the charts. The other chart will also move slightly.

    I have prepared a workbook with a macro which demonstrates this. Just run the macro which moves the left chart by 10 points to the left and you will see the right chart move as well. Here is a link to the workbook.

    Tuesday, August 8, 2017 2:13 PM

Answers

  • Hi Mitja,

    I could reproduce your issue, I suggest you set zoom to 100% temporarily when you move the chart and set it back after moving the chart.

    Here is the example.

    Sub Macro1()

        zm = ActiveWindow.Zoom

        Application.ScreenUpdating = False

        ActiveWindow.Zoom = 100

        ActiveSheet.Shapes("Chart 3").IncrementLeft -10

        ActiveWindow.Zoom = zm

         Application.ScreenUpdating = True

    End Sub

    Best Regards,

    Terry

    Wednesday, August 9, 2017 7:24 AM

All replies

  • Hi Mitja,

    I could reproduce your issue, I suggest you set zoom to 100% temporarily when you move the chart and set it back after moving the chart.

    Here is the example.

    Sub Macro1()

        zm = ActiveWindow.Zoom

        Application.ScreenUpdating = False

        ActiveWindow.Zoom = 100

        ActiveSheet.Shapes("Chart 3").IncrementLeft -10

        ActiveWindow.Zoom = zm

         Application.ScreenUpdating = True

    End Sub

    Best Regards,

    Terry

    Wednesday, August 9, 2017 7:24 AM
  • We did just that. Just wanted to make sure you are aware of it.
    Wednesday, August 9, 2017 7:44 AM