If I understood the question, I ran into the same problem. Whenever there are several overlapping diagrams, their visualization priority follows ZOrder .
In Excel 2003, when you selected a chart, it appeared in the foreground (at least for visualization, I donβt know if its ZOrder was temporarily changed). When the chart was canceled, its visualization priority returned to "normal."
Starting with Excel 2007, graphs are not brought to the forefront for visualization when they are selected, therefore, if they are buried behind other diagrams (or, possibly, with other Shape s), the only option to see them completely is to bring them in front. This has two drawbacks: 1) it takes more clicks, 2) the lost (possibly intended) ZOrder .
Even John Peltier , in May 5, 2009 , noted that there is no workaround for this.
I tried to find a solution based on:
- Chart activation detection.
- Saving the current
ZOrder for later use. - Bringing it forward.
- Deselecting the chart, restoring the original
ZOrder .
This is the main idea, and the circuit works pretty well , with a few glitches. I really based my code on the Jon Peltier page provided here by Brettj. One of the modifications is
Private Sub EvtChart_Activate() Application.EnableEvents = False ActivatedChart = EvtChart.name If (TypeName(EvtChart.Parent) = "ChartObject") Then ' Chart is in a worksheet Dim chObj As ChartObject Set chObj = EvtChart.Parent chObj.BringToFront Else ' Chart is in its own sheet End If Application.EnableEvents = True End Sub
Use something similar for EvtChart_Deactivate . I hope this idea is helpful.
source share